0

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.

ישו אוהב אותך
  • 28,609
  • 11
  • 78
  • 96

3 Answers3

0

just call finish(); in order to destroy your Activity

Carnal
  • 21,744
  • 6
  • 60
  • 75
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
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