0

Suppose I quit an app, say Amazon. How can I fire up an intent or view right after it closes? I also want the app name or package Name which was closed..

For example, the way truecaller does it. It opens a view right after you call someone..

  • 1
    I know of no way to do this. TrueCaller is probably listening for a phone state change and performing an action in response to that. – Karakuri Feb 20 '16 at 22:52

2 Answers2

0

There is no possibility to do that - it is rather insecure from users perspective.

TrueCaller is listening on PHONE_STATE event.

Gaskoin
  • 2,469
  • 13
  • 22
0

If you want to implement this, You need to get a list of all installed apps and check if each app is running or not and then do your logic. And you can't compare your state with a truecaller. Cause truecaller is using a broadcast receiver which is an Android component which allows you to register for system or application events.

And to fully understand the ability to know when an app shuts down check this answer

Community
  • 1
  • 1
abozaid
  • 967
  • 8
  • 11