java - Back to the previous activity -


i have 3 activities (home ,first , second )

homescreen-->firstactivity-->secondactivity

intent intentmap = new intent(firstactivity.this, secondactivity.class); startactivity(intentmap); 

when i'm in secondactivity , click button , return home page ,i want return previousactivity , how can ?

from comments must calling finish() firstactivity.

pressing backbutton lead previous activity.

when navigate firstactivity secondactivity. firstactivity paused. second activity put on stack , takes focus.

http://developer.android.com/reference/android/app/activity.html

when press button current activity in stack popped , destroyed. previous activity in stack takes focus.

i suggest @ activity lifecycle , activity stack further details

http://developer.android.com/guide/components/tasks-and-back-stack.html


Comments

Popular posts from this blog

assembly - 8086 TASM: Illegal Indexing Mode -

Java, LWJGL, OpenGL 1.1, decoding BufferedImage to Bytebuffer and binding to OpenGL across classes -

javascript - addthis share facebook and google+ url -