0

I have an Activity DetailsActivity that is accessible from two different Activities: MapActivity and ListActivity. How should I implement Up Navigation to select proper Activity as Parent?

enter image description here

Ali Behzadian Nejad
  • 8,804
  • 8
  • 56
  • 106

2 Answers2

0

You can set a flag while going into the details activity from any one of the activities. Then onBackPressed you can fire that particular intent depending on the flag you first sent in.

nick92
  • 46
  • 4
0

I had the same problem and in my case rearanging the code worked perfectly. If you have the same logic in two classes, rather then inheritance, try to create another class, which will do the whole work for us. Simple add a new atribute to Details Activity and (List Activity or Map Activity).

user1398619
  • 696
  • 7
  • 8