0

i want to run the last line code after the activity is close, the activity is share activity like this. enter image description here

When click other application (ex: Gmail), the last line code run first before open the apps. Say "Couldn't attach file".

enter image description here

Code :

// Set Intent and Start Activity, the user from global
Intent shareIntent = MailController.setEmailAndIntent(uris,user);
startActivity(Intent.createChooser(shareIntent, Constants.share_intent_title));

// when activity close then run code below, but before the activity closed this code is run.
PersonController.deleteEnrollFile(getBaseContext());
  • Try looking at [Run code when Android app is closed/sent to background](https://stackoverflow.com/questions/5593115/run-code-when-android-app-is-closed-sent-to-background?adlt=strict&toWww=1&redig=9469024AE615464F91A86204FF200D7D). – Alias Cartellano Oct 28 '22 at 22:29

0 Answers0