I want to change theme mode to dark like below:
AppCompatDelegate.setDefaultNightMode(AppCompatDelegate.MODE_NIGHT_YES)
I use it in the avtivity creation function and get this error:
java.lang.IllegalArgumentException: Parameter specified as non-null is null: method kotlin.jvm.internal.Intrinsics.checkParameterIsNotNull, parameter view
Considering the activity has some fragments, I think I should recreate the activity and send it to fragments, but I don't know how. Any help will be appreciated.