views:

25

answers:

1

I would like my app to do something when another application is opened.

The current approach I have taken is to create a broadcast receiver that monitors all

android.intent.action.MAIN

events, but either I am not doing it correctly or the way I am going about it is incorrect. The section of the manifest looks like this:

<receiver android:name=".GetApp"> 
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />
            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>
    </receiver>

I included the launcher category just as a test. GetApp currently is only set to make a log entry when called.

If anyone has any experience doing something like this your help would be greatly appreciated!

+1  A: 

After doing some more digging in the Android documentation I found that a broadcast receiver would not pick up on an app starting because it goes through createActivity(). Calls to createActivity() are not considered broadcasts and therefore cannot be received by broadcast receiver.

Andrew Guenther
Yes, I'm fairly sure this is not possible
Falmarri