2

Is there any way to get user launching app information like package name or any information about that application.

i make one service which get all running process and then i just compare with my deserving package name but i want Broadcast intent.

Is there any broadcast intent receiver which revive user launching app info ?

Bhanu Sharma
  • 4,946
  • 1
  • 21
  • 46
  • Take a look [ACTION_PACKAGE_ADDED](http://developer.android.com/intl/es/reference/android/content/Intent.html#ACTION_PACKAGE_ADDED). May be helpful to you – M D Mar 11 '16 at 10:09
  • i want user's launching application every time ACTION_PACKAGE_ADDED == when u try to install any pkg but i want any time if user launch X app then i want intent for that – Bhanu Sharma Mar 11 '16 at 11:16
  • Ok actually i don't know much more about this. – M D Mar 11 '16 at 11:17

1 Answers1

1

This code works for me, Hope it help you too.

IntentFilter addFilter = new IntentFilter();
addFilter.addAction(Intent.ACTION_PACKAGE_ADDED);
addFilter.addAction(Intent.ACTION_PACKAGE_INSTALL);
addFilter.addDataScheme("package");
registerReceiver(yourReceiverName, addFilter);
Sagar Thakarar
  • 301
  • 3
  • 18