Intermediate Progress doesn't work with ActionBarSherlock running on Gingerbread

前端 未结 4 1761
长发绾君心
长发绾君心 2021-01-18 19:33

I setup ActionBarSherlock with my app, and I\'m trying to use the Intermediate Progress, I\'m using this:

    requestWindowFeature(Window.FEATURE_IN         


        
4条回答
  •  醉酒成梦
    2021-01-18 20:02

    Check, if you are using Theme.Sherlock.NoActionBar or similar no action bar theme for this activity. In this case setSupportProgressBarIndeterminateVisibility method fails for me with

    Caused by: java.lang.NullPointerException
    at com.actionbarsherlock.internal.ActionBarSherlockCompat.updateProgressBars(ActionBarSherlockCompat.java:710)
    at com.actionbarsherlock.internal.ActionBarSherlockCompat.onIntChanged(ActionBarSherlockCompat.java:686)
    at com.actionbarsherlock.internal.ActionBarSherlockCompat.updateInt(ActionBarSherlockCompat.java:681)
    at com.actionbarsherlock.internal.ActionBarSherlockCompat.setFeatureInt(ActionBarSherlockCompat.java:665)
    at com.actionbarsherlock.internal.ActionBarSherlockCompat.setProgressBarIndeterminateVisibility(ActionBarSherlockCompat.java:637)
    at com.actionbarsherlock.app.SherlockFragmentActivity.setSupportProgressBarIndeterminateVisibility(SherlockFragmentActivity.java:282)
    

    I guess you should use a progress dialog instead to indicate loading process or regular Theme with activity title bar and then use setProgressBarIndeterminateVisibility method for older platforms.

提交回复
热议问题