I'm trying to submit a form using a web service done with GlassFish in Java and save the data in a PostgreSQL database. I am using AsyncTask to send data. The problem I have is that when I've finish sending the data I want to destroy the activity and return to the main page.
Asked
Active
Viewed 115 times
3 Answers
0
Call finish();
when you want to kill the Activity.
See link for further research: How to kill an Android activity when leaving it so that it cannot be accessed from the back button?

Community
- 1
- 1

Joseph Malachosky
- 85
- 8
0
if you are in a sub-method, listeners, etc.:
youractivityclass.this.finish();
if you are directly on your activity class just call
finish()

Paulo Rodrigues
- 723
- 1
- 5
- 16