android - Require a progress bar in action bar -
I need a progress bar in my action bar, I am able to use the following code: -
@Orride Creatives (bundle saved instainstate) on public zero {super.onCreate (savedInstanceState); RequestWindowFeature (Window.FEATURE_INDETERMINATE_PROGRESS); RequestWindowFeature (Window.FEATURE_PROGRESS); SetContentView (R.layout.main_screen); Progress = (LinearLayout) findViewById (RID progression); SetProgressBarIndeterminateVisibility (Boolean.FALSE); This.setprogressBarIndeterminate (true); } However, I also see a spinner along with the progress bar. I can tell anyone how to hide the spinner. Also I need to move the progress bar below the action bar.
The progress bar is used when we should take action in the background. You can use it anywhere The following examples can be useful:
Personal progress DIOLOG PDialog; Protected void onCreate (bundled saved instenstate) {super.onCreate (SavedInstanceState); SetContentView (R.layout.examplelayout); New example () carry about (); } Class example AsyncTask and lt; Zero, zero, string & gt; {// Personal progress dialog dialog; Personal Progress Deblog Dialogue = New Progress Deeog (Example Layout.); Protected on @OverridePreExecute () {// This progress bar will load the skins used in podialog = new progression DLOOgh (examplelayout.this) in the doInBackground method load; PDialog.setMessage ("Loading ..."); PDialog.setCancelable (true); PDialog.setTitle ("in progress ..."); PDialog.setIcon (android.R.drawable.stat_sys_download); PDialog.setMax (100); PDialog.show (); } @ Override protected string doInBackground (zero ... parameter) {yourMethod (); // Any action returns null; } @Override Secure Zero PostExecute (string result) {dialog.dismiss (); }}
Comments
Post a Comment