I am setting the night mode in onCreate of an activity. So every single activity in the app turns to night mode and all the previous activities gets recreated. But I need only that particular activity to be in night mode and all other activities to be in light mode. How to achieve this ? Below line of code I am using in oncreate of an activity to set to night mode.
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)