0
I have an app that downloads and sends files via ftp. When the app starts it receives a text file and would like to send the file when the application is closed. I searched on how to do something when the application closes and found the methods onStop and onDestroy, but I don’t know if I’m doing it the right way
public void onStop(Bundle savedInstanceState)
{
metodo
}
would be to call onStop method and inside it perform upload activity to the FTP server for example?
Because I call the download activity within the onCreate method and it works well
Use
onDestroy
, is he who is called when theActivity
is deleted from memory by Android or when you close the application.– user28595
Recommended reading: Understanding the lifecycle of an Android app and Fragments life cycle on Android
– user28595