tags:

views:

46

answers:

2

Hi friends,

1 . can we get any event when user tap/touch native application(i.e. messaging,contacts).

2 . i know that any application launch by intent in android, there is any way to know which application launch with launch of application.

Thanks

A: 

For (1): what do you mean by 'tap/touch'? Do you mean when the built-in applications are launched, or when they're interacted with?

If you mean launching, you can listen to any intents being fired by the system by registering a broadcast receiver. If you set your IntentFilter to receive intents with CATEGORY_LAUNCHER, you should be able to see when the launcher starts applications.

See:

http://developer.android.com/reference/android/content/Intent.html#CATEGORY_LAUNCHER

http://developer.android.com/reference/android/content/BroadcastReceiver.html

If you mean interacting, I don't think you can do that.

For (2): I don't believe that intents remember where they were constructed, so I don't think this is possible. I could be wrong, however.

David Given
You cannot listen for start-activity Intents with a BroadcastReceiver, as they are not broadcast Intents.
CommonsWare
Dang.http://stackoverflow.com/questions/3290936/android-detect-when-other-apps-are-launchedhas more information on why this can't be done.
David Given
A: 

can we get any event when user tap/touch native application(i.e. messaging,contacts).

Not generally. Most of these icons are tied to their applications.

there is any way to know which application launch with launch of application.

This makes no sense to me, sorry.

CommonsWare
hi sorry but its there is any way to know which application launch with launch of intent.
dhaiwat