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?
Asked
Active
Viewed 231 times
0

Ali Behzadian Nejad
- 8,804
- 8
- 56
- 106
2 Answers
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
-
onBackPressed works fine. I want to have `up navigation` in ActionBar. – Ali Behzadian Nejad Nov 04 '14 at 18:28
-
Inside ActionBar too, I don't see any problem just call finish() so that you can have your previous activity who has created it. – Chitrang Nov 04 '14 at 19:04
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