I have an app which the moment the user starts running the app it register a new entry in a database. The thing is that when the user quits I would like to delete this registry in the database. I know doing al these inserts and deletes with JSON, MySQL and PHP but I dont know how to apply these functions when the user quits the application in the normal way. I would like to know if there is a function like public onBackPressed() where it does always the same thing but you can overwrite it.
Thanks
There is a method onDestroy() which is called when user is done with application and resources are freed, you can override it in your activity and do whatever you want in it, if you want a one step previous from onDestroy() it is onStop() which is called when activity goes background etc. You can override it as well.