Android, how to detect that the activity is back from another activity?
android
Solution
`onCreate` wont get called in case of back press.
There are multiple ways you can infer if you have arrived at this activity by back key press.
Set a `boolean` in oncreate that says on `onCreate` is called.
Start C activity by calling `startActivityForResult` and when you return from C `onActivityResult` will get called.
Problem
For Android, suppose 3 activities, a1 a2 a3, with their click hierarchy, a1->a2->a3. My questions is in a2, how to detect it is from a3 by pressing the back key, instead of entering from a1?