SupportMapFragment lags and all together has a bad performance after it's back from stack.
The promblem is strange because I use navigation graph for navigation purposes and the problem is not always present. Here are the two different scenarios:
MapFragment -> AnotherFragment (Through ActionBar menu item) -> Mapfragment
override fun onOptionsItemSelected(item: MenuItem?): Boolean {
onNavDestinationSelected(item!!, navController)
return super.onOptionsItemSelected(item)
}
In this case the MapFragment is lagging after back button pressed in AnotherFragment
MapFragment -> AnotherFragment (Through a default button) -> Mapfragment
navController.navigate(R.id.action_mapFragment_to_anotherFragment)
In this case the MapFragment acts normally.
I have tried to use navController.navigate(R.id.action_mapFragment_to_anotherFragment)
in onOptionsItemSelected(item: MenuItem?)
but I ended up with the same result.
I also know about this question with the same problems but under really different circumstances also the answers are not really helpful.