I actually just found that recreate is ignoring animations set in theme so I need to do it just manually:
class SomeActivity:AppcompatActivity(){
...
override fun recreate() {
finish()
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
application.startActivity(Intent<InstrumentsActivity>(this))
overridePendingTransition(android.R.anim.fade_in, android.R.anim.fade_out)
}
...
}
PS: You need to call startActivity on application context for transition to be there.
So instead of calling it elswere I just override recreate in activity subclass I already use.
I dont use savedInstanceState
, so no need to deal with anything else..
Edit: So in the end I added also those annimation overrides as this was behaving differently on older android version.. (api 26) Added for finish as well as start as this should be places after the overriden call ..