Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to change theme of app in android studio programmatically

So, to switch between themes dynamically you simply need to call 
setTheme before super.onCreate like this:

  public void onCreate(Bundle savedInstanceState) {
      setTheme(android.R.style.Theme);
      super.onCreate(savedInstanceState);
      setContentView(R.layout.activity_second);
  }
  
 
PREVIOUS NEXT
Tagged: #change #theme #app #android #studio #programmatically
ADD COMMENT
Topic
Name
5+4 =