This is problematic because it’s hard to provide a seamless experience to the user if you have to restart the app or Activity in order to change the theme. That being said, it is possible to change the theme of an Activity, however only in the `onCreate` method and only before `super` is called. The use case is often that there is a setting, button or check box which can switch between different colour themes or between something like day and night mode.Įvery time such a requirement comes up, the first thing a quick Google search shows is that it’s not possible to change themes at runtime. Every so often, I see a question posted on StackOverflow which is effectively asks how to change the themes of an app at runtime.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |