0

I need to capture device default application open and close events. as example when user open browsers I need to capture that event. is there any specific permission to capture it and good example?

Nanne
  • 64,065
  • 16
  • 119
  • 163
Chandana
  • 2,578
  • 8
  • 38
  • 55

1 Answers1

0

You can use an intent-filter in your manifest. Read the manual here: http://developer.android.com/guide/topics/intents/intents-filters.html

or check this example I got from SO ( Android Respond To URL in Intent )

<intent-filter><action android:name="android.intent.action.VIEW"></action>
<category android:name="android.intent.category.DEFAULT"></category>
<category android:name="android.intent.category.BROWSABLE"></category>
<data android:host="www.youtube.com" android:scheme="http"></data>
</intent-filter>

You don't need any special permissions by the way.

Community
  • 1
  • 1
Nanne
  • 64,065
  • 16
  • 119
  • 163
  • Is it same for Talk chat application? What should be 'android:host' and 'android:scheme'? – Chandana Dec 19 '11 at 15:25
  • Depends what you want to filter. If you don't want to filter anything you don't need to specify it I guess, then you'll trigger on all intents from that category. Did you read the link about intent-filters? – Nanne Dec 19 '11 at 15:37
  • Yes, I have read that post. But that solution doesn't work for me. when I go to youtube, My New Activity not invoked. – Chandana Dec 19 '11 at 16:10
  • youtube? but you were talking about what to filter for talk chat? Anyway, I meant this one: http://developer.android.com/guide/topics/intents/intents-filters.html – Nanne Dec 19 '11 at 16:16
  • No NO I just check that youtube example. It's also not working. – Chandana Dec 19 '11 at 16:21
  • OK, READ the MANUAL from the android page. It explains what you need to do. You're not making helping you any easier by just typing "no it not work". If that's all you have to add then I'd rather spent my time elsewhere... – Nanne Dec 19 '11 at 16:32