Skip to content

Instantly share code, notes, and snippets.

@trinnguyen
Last active December 18, 2016 08:20
Show Gist options
  • Save trinnguyen/13a8ac2689df4930d858cecd3f427322 to your computer and use it in GitHub Desktop.
Save trinnguyen/13a8ac2689df4930d858cecd3f427322 to your computer and use it in GitHub Desktop.
Android refresh Activity when changing Theme at runtime
private void applyTheme() {
//Option 1: //Recreate screen
// recreate();
//Option 2: Start and Finish with Animation
startActivity(new Intent(this, this.getClass()));
finish();
// overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out);
overridePendingTransition(0, 0);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment