I have an activity. After checking some stuff, I want to go back to previous activity if a previous exists, and if not I want to start a SpecificActivity. How do i do it?
Edited: Seems like no one is understanding what I meant, so let me rephrase. Lets say I am in Activity A. I don't know if A is the only activity in the stack. If there are other activities, then I want to finish A and pop the activity right below A in the stack into the foreground. If A is the only activity in the stack, I want to start some activity Z. How do i do it?