Skip to content

Latest commit

 

History

History
21 lines (16 loc) · 1008 Bytes

android-progress-spinner.md

File metadata and controls

21 lines (16 loc) · 1008 Bytes

title: Android progress spinner in Actionbar tags: android,android-progress

You can get a indeterminate progress bar like http://i.stack.imgur.com/CY4Ss.png in your window or Actionbar easily enough:

  1. Inserting this before you set your view in onCreate: requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);

  2. Enable and disabling it via setProgressBarIndeterminateVisibility(true);

     @Override
     protected void onCreate(Bundle savedInstanceState) {
         super.onCreate(savedInstanceState);
         requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS);
         setContentView(R.layout.activity_main);
     
         // Turn it on
         setProgressBarIndeterminateVisibility(true);
         // And when you want to turn it off
         setProgressBarIndeterminateVisibility(false);
     }
    

You can also use this in ActionbarSherlock via setSupportProgressBarIndeterminateVisibility and using ABS's Window class for the feature instead.