jabben wrote:
> I'm trying to write a BroadcastReceiver which is to be notified
> whenever the user plays an audio file. Have looked around for an
> appropriate Intent to use and android.intent.action.VIEW seems to be
> the closest one. I don't get any notifications though and wonder what
> I'm doing wrong.
> 
> /j
> 
> 
> Here is the full code:
> 
> <?xml version="1.0" encoding="utf-8"?>
> <manifest xmlns:android="http://schemas.android.com/apk/res/android";
> package="org.jabben">
>   <application android:label="MyProject">
>     <receiver android:name=".MyReceiver" android:label="My Receiver">
>       <intent-filter>
>         <action android:name="android.intent.action.VIEW" />
>       </intent-filter>
>     </receiver>
>   </application>
> </manifest>

To quote from the documentation for IntentFilter:

"Note that for an IntentFilter to match an Intent, three conditions must 
hold: the action and category must match, and the data (both the data 
type and data scheme+authority+path if specified) must match."

Your <intent-filter> only attempts to match on the action.

The details for the Intent(s) you would want to filter upon will vary by 
application and may not exist. For example, here is some information 
about the MediaPlayback app:

http://www.openintents.org/en/node/112

-- 
Mark Murphy (a Commons Guy)
http://commonsware.com

Android Training on the Ranch! -- Mar 16-20, 2009
http://www.bignerdranch.com/schedule.shtml

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to