Reputation: 45
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
Upvotes: 0
Views: 2822
Reputation: 3288
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.
Upvotes: 1
Reputation: 1970
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.
Upvotes: 0