How can I write a Broadcast Receiver that will be invoked when user clicks on any application icon?
I tried by writing:
<receiver android:name = "myreceiver">
<intent-filter>
<action android:name = "android.intent.action.MAIN">
</intent-filter>
</receiver>
But it is not called.
I tried,
by using Packagemanager
I will get ApplicationInfo
. From that I can know all the application starting activity name and package names. I thought I can use them to registerReceiver
and my receiver will listen by its launching activity and package name.
But I strucked. I am unable to do that. I think I lost the way.
What can I do to solve this problem?