Switching application-wide theme programmatically?

若如初见. 提交于 2019-11-26 12:11:55

Create a base Activity for your app and override onCreate to set the theme. Derive all your other activities from this base Activity.

Also check this tutorial: http://www.androidengineer.com/2010/06/using-themes-in-android-applications.html

There may be a good solution to this, but I couldn't find one, so I ended up making a little static helper method in a helper class that takes an Activity and basically performs those two lines you wrote. Sure, it's not perfect, but just adding one short line of code to every onCreate() method in my app was tolerable.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!