I want to unload activity .Actually i have three buttons one for login ,proceed and last for logout.when we login home page is appears and when we click on logout then once again login form should appears but problem is this when we logout then all the activity except login activity should destroyed .So please suggest me how to do this.Thanks
Asked
Active
Viewed 2,774 times
0
-
Show us what you have done. This looks pretty straight forward. – Deva Apr 20 '12 at 06:38
-
Learn managing activity in android. see activity features : finish startActivity , intent flags like cleartop and so on.. after that you will have an idea how to implement this – Connecting life with Android Apr 20 '12 at 06:48
2 Answers
1
There are many ways to do this.
One way is Before launching new activity,you better call finish(). It will close current activity and you can open new activity. On clicking logout, you just call intent which shows login form.
If you learn how to manage activities in stack, then u can achieve this in different way.

Raghu Nagaraju
- 3,278
- 1
- 18
- 25
0
Activities are managed in a stack in android. What you need to do is to go back in activity stack. You could call finishActivity()
.
Here is another thead.

Community
- 1
- 1

Jermin Bazazian
- 1,932
- 2
- 17
- 20
-
1Finally i used this code and its working fine @Override public void onBackPressed() { // TODO Auto-generated method stub super.onBackPressed(); this.finish(); } – Sunny Apr 20 '12 at 08:14