나는 다음과 같은 부모 XML을하위 항목에서 상위 항목의 레이아웃 항목에 액세스하는 방법?
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/list_places_linearLayout" >
<LinearLayout
android:id="@+id/loadingPanel"
style="@style/GenericProgressBackground" >
<ProgressBar style="@style/GenericProgressIndicator" />
</LinearLayout>
<com.example.ListView
android:id="@+id/bottomactionbar"
style="@style/BottomActionBar" />
</LinearLayout>
을 com.example.ListView은 AsyncTask를이 포함되어 내 사용자 지정 구성 요소가 있습니다. 이 작업이 완료되면 부모의 ProgressBar 가시성을 GONE으로 설정하려고합니다.
이LinearLayout llParent = (LinearLayout)getParent();
((LinearLayout)llParent.findViewById(R.id.loadingPanel)).setVisibility(View.GONE);
불행하게도 라인 llParent.findViewById (R.id.loadingPanel가) 널 (null)입니다 ... 어떤 기회가 내가 이것을 극복 할 수 AsyncTask를이 하위 구성 요소에서 수행 될 때
그래서, 나는 다음과 같은 시도 발행물?
감사합니다, 펠리페
널 (null) 무엇인가? llParent 또는 findViewById()를 호출 한 결과? –