setHasOptionsMenu(true);
lunes, 23 de septiembre de 2013
Show ActionBar items within fragments
To enable OnCreateOptionsMenu, onPrepareOptionsMenu, onOptionsItemSelected, in fragment, you have to call setHasOptionsMenu within the fragment’s onCreate() method:
miércoles, 18 de septiembre de 2013
martes, 3 de septiembre de 2013
ProgressBar in ActionBar
For using the indeterminate progress bar in the actionbar, just a few steps:
Put requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); before setContentView();
and use the function setProgressBarIndeterminateVisibility(true); for start the spining and setProgressBarIndeterminateVisibility(false); to stop
Put requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); before setContentView();
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS); setContentView(R.layout.extern_main); }
and use the function setProgressBarIndeterminateVisibility(true); for start the spining and setProgressBarIndeterminateVisibility(false); to stop
Suscribirse a:
Entradas (Atom)