I have an ActionMode
in my fragment that I want only to run in the portrait mode; so I called actionMode.finish()
in the onConfigurationChanged()
fragment callback to stop the ActionMode if the orientation in the landscape:
override fun onConfigurationChanged(newConfig: Configuration) {
super.onConfigurationChanged(newConfig)
if (orientation == Configuration.ORIENTATION_LANDSCAPE)
actionMode.finish()
}
This does work but Android studio warns me that "Calling finish() within onConfigurationChanged() can lead to redraws".
Is there a better way to finish the ActionMode in landscape without having to worry about that redrawing?