Android Get a link to TabActivity from tabbed content.

I have a class for my TabActivity

public class DashboardActivity extends TabActivity

It has several tabs and an action bar. One of these tabs is a list of items.

public class WalletActivity extends ExpandableListActivity

I want to be able to run an asynchronous task in one of the child actions, and although it works, there is a spinner show on the action screen. I already do this in the AsyncTaskin my activity tab

ActionBar actionBar = (ActionBar)findViewById(R.id.actionbar);

if(actionBar != null)
    actionBar.setProgressBarVisibility(View.VISIBLE);

How can I link DashboardActivityto where my tab is placed WalletActivity?

+3
source share
1 answer

, Activity . Activity (TabActivity, ActivityGroup ..), , spinner/dialog/what in there.

public Context getDialogContext(Activity act) {
    Context context;
    if (act.getParent() != null) 
        context = act.getParent();
    else context = act;
        return context;
}
+4

All Articles