3

I have 3 activities - Activity A, Activity B and Activity C. the transitions are as follows

A->B and B->A , A->C and C->A

now, when I am returning to A, I need different animation for the transition, depending on whether I am coming from B or C.

Activity A is the home page of the app, so I am going from A->B or A->C using Textviews but from both of them, I am returning to A using the hardware back button.

So, my question is how can I detect in A, whether I am returning from A or B and apply the transition animation accordingly?

Yash
  • 5,225
  • 4
  • 32
  • 65

2 Answers2

0

use a static variable integer type, when you satart activity B set the integer value 1, when you start C set value 2. and check every time in OnResum() the value of Integer.

Mudassar Shaheen
  • 1,397
  • 1
  • 9
  • 15
  • 1
    As you know that `OnResum()` is not good point to set these kind of variables as it often called when some dialog comes in front of some activity. – Ali Imran Dec 14 '12 at 11:32
0

I solved it using startActivityForResult method as it is more clean and reliable way.

Yash
  • 5,225
  • 4
  • 32
  • 65