Showing indeterminate progress in Sherlock Action Bar

后端 未结 3 2110
[愿得一人]
[愿得一人] 2021-02-18 21:04

i`m trying to show indeterminate progress bar in ABS v. 4.0.2 by following code

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(sa         


        
相关标签:
3条回答
  • 2021-02-18 21:20

    Make sure you import com.actionbarsherlock.view.Window, not android.view.Window.

    0 讨论(0)
  • 2021-02-18 21:20

    do this:

    requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
    setContentView(R.layout.section_one1);
    setSupportProgressBarIndeterminateVisibility(false);  
    

    on anything clickable like starting an activity via intent or adapters or whatever show your progressbar on click

    setSupportProgressBarIndeterminateVisibility(true);
    

    but using this method when the user goes back to the activity the progress dialog will be visible still. There are many ways to stop it but the easiest one is just to use

       @Override
        public void onBackPressed()
        { 
        NavUtils.navigateUpFromSameTask(this);
            super.onBackPressed();
        }
    
    0 讨论(0)
  • 2021-02-18 21:28

    Try setSupportProgressBarIndeterminateVisibility(boolean) to get backward compatibility.

    0 讨论(0)
提交回复
热议问题