My TabActivity contains ProgressBar and two tabs (Activities with ListView).
Where does I must initialize progress = (ProgressBar)findViewById(R.id.progress_bc); and how can I set progress.setVisibility(View.GONE); from onItemClick in ListView in Activity?
<ProgressBar
android:id="@+id/progress_bc"
android:indeterminate="true"
android:layout_width="18dip"
android:layout_height="18dip"
style="@android:style/Widget.ProgressBar.Small"/>
The initialization should be to the
Activitywhere you want to show the dialog. So it is better to have twoProgressBar, one for every layout of your twoActivitiesand control it there.So in the tab parent Activity (call it CustomTabActivity):
In the
onCreate()you initialize the dialog.Now when you want to use it from a child Activity, you use:
((CustomTabActivity)getParent()).dialog.show();orHope this helps!