I am opening a file using the ACTION_VIEW intent from my app.
Now i want to perform some actions in my app whenever this file is closed.
This can be closed either by pressing back or by the context menu option of the app that opened the file.
Is there a way my app can get to know when a file is closed
when you want to launch the other app, use
startActivityForResult()instead ofstartActivity(). And override theonActivityResult()method in your activity class. Most of the apps return a result ofRESULT_OKorRESULT_CANCELEDwhen the user exits from their app. And when they exit,onActivityResult()method will be called in your app, where you can put code to do whatever you want after that. Check the android doc for more help and info