Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Help on Back Button

 
Sreenu Vengala
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends.

In my IM Application once user signout the application, it shows login screen,
from here user click on back button again showing the contact list screen.

How to remove activities from the stack, any one help on this.


Thanks..
Srinu
 
Monu Tripathi
Rancher
Posts: 1369
1
Android Eclipse IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you launch a new Intent() that resolves to an Activity, the new Activity is launched and brought in front (and your existing Activity is pushed behind). To paraphrase, a new Activity is created, started,displayed and pushed on the History stack. When you press the back button the current Activity is "pop"ed from the Stack and removed from display. This will bring your initial,earlier activity to the front.

If you don't want your calling activity to remain on the stack, you should call finish() after launching the intent that resolves to a new Activity.
Take some time to read the following article:
Activities and Tasks
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic