I have a requirement that when a switch is clicked, I need to invert the mode from dark to light and vice versa respectively. But the twist part is, that I do not want to finish the activity and restart it as I don't want the flash/flicker of activity recreation to be noticed by the user. Hence, I use Activity.this.recreate(). Now, this works well in all API levels and phones I checked so far. But, in Android Pie, it shows a kind of flash even while using Activity.this.recreate()
Anyone please suggest me some way to solve the issue in Android Pie, or some better way to approach my concern.
from Flash when changing to dark/light mode dynamically
No comments:
Post a Comment