Last active
December 18, 2016 08:20
-
-
Save trinnguyen/13a8ac2689df4930d858cecd3f427322 to your computer and use it in GitHub Desktop.
Android refresh Activity when changing Theme at runtime
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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