Search code examples
androidandroid-actionbaractionbarsherlockandroid-viewpagerviewpagerindicator

Setting setSupportProgressBarIndeterminate in SherlockFragments with SherlockActivity


I'm using Jake's ActionBarSherlock and ViewPagerIndicator. I realized I can't set setSupportProgressBarIndeterminate in SherlockFragments with SherlockActivity.

In SherlockActivity, I have

@Override
protected void onCreate(Bundle arg0) {
        super.onCreate(arg0);
        requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
        setTheme(R.style.Theme_Sherlock_Light_DarkActionBar);
        ActionBar actionbar = getSupportActionBar();
        actionbar.setDisplayHomeAsUpEnabled(true);
        //setSupportProgressBarVisibility(true);
    }

And in my SherlockFragment's Asynctask

@Override
        protected void onPreExecute() {
            getSherlockActivity().getSupportActionBar();
            getSherlockActivity().setSupportProgressBarVisibility(true);
            getSherlockActivity().setSupportProgressBarIndeterminate(true);
        }

The progressbar does not appear. Any reason for that?

Thanks in advance.


Solution

  • You need to use setSupportProgressBarIndeterminateVisibility to make the indeterminate progress bar show.