Reputation: 715
I have a MapView in the MainActivity. User can roam maps. There are many activities. I want to go back to MainActivity from any activity that can be third or fourth level activity. I am following this answer. It is a solution to go back from second activity to Parent with data. But when I am trying to go back to parent from 3rd or 4th activity finish()
will not work as it will return previous activity. So I have started the parent activity with startActivity(mainIntent)
. The problem is its reloading the MapView from its start, the parent Intent is reloading. How can I pass data from third or fourth activity to parent without reloading the MapView?
Upvotes: 0
Views: 1025
Reputation: 715
mainIntent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP | Intent.FLAG_ACTIVITY_SINGLE_TOP);
Worked!!!
Upvotes: 2