Skip to content

Instantly share code, notes, and snippets.

@kennydude
Created August 29, 2012 13:43
Show Gist options
  • Save kennydude/3512711 to your computer and use it in GitHub Desktop.
Save kennydude/3512711 to your computer and use it in GitHub Desktop.
ProgressBar in ActionBar
public boolean onCreateOptionsMenu(final Menu menu) {
// Inflate Layout here
// ProgressBar
if(isRefreshing){
ProgressBar p = new ProgressBar(this, null, android.R.attr.progressBarStyleSmall);
menu.findItem(R.id.refreshAction).setActionView(p).setEnabled(false);
}
// Do other crazy stuff here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment