You need to add the file:// scheme to your receiver's intent filter.
On Thu, Jun 18, 2009 at 10:01 AM, JayBird <[email protected]> wrote: > > Hi Folks, > > I'm trying to detect media events. As a test I created a simple > broadcast receiver so that I can understand the media events. > However, for some reason I'm not receiving the broadcast. Here is my > code segment and manifest below > > <?xml version="1.0" encoding="utf-8"?> > <manifest xmlns:android="http://schemas.android.com/apk/res/android" > package="com.test" > android:versionCode="1" > android:versionName="1.0"> > <application android:icon="@drawable/icon" android:label="@string/ > app_name"> > <receiver android:name=".MSDEBroadcastReceiver"> > <intent-filter> > <action > android:name="android.intent.action.ACTION_MEDIA_BAD_REMOVAL" /> > <action > android:name="android.intent.action.ACTION_MEDIA_MEDIA_CHECKING" /> > <action > android:name="android.intent.action.ACTION_MEDIA_EJECT" /> > <action > android:name="android.intent.action.ACTION_MEDIA_MOUNTED" /> > <action > android:name="android.intent.action.ACTION_MEDIA_NOFS" /> > <action > android:name="android.intent.action.ACTION_MEDIA_REMOVED" /> > <action > android:name="android.intent.action.ACTION_MEDIA_SHARED" /> > <action > android:name="android.intent.action.ACTION_MEDIA_UNMOUNTABLE" /> > <action > android:name="android.intent.action.ACTION_MEDIA_UNMOUNTED" /> > <action android:name="com.test.JAY" /> > </intent-filter> > </receiver> > </application> > > </manifest> > > ---- Code Segment ---- > > package com.test; > > import android.content.BroadcastReceiver; > > public class MSDEBroadcastReceiver extends BroadcastReceiver { > @Override > public void onReceive(Context context, Intent intent) { > // Get the details of the intent > String action = intent.getAction(); > Log.i(LOG_TAG, "-----> IntentAction: " + action); > } > private static final String LOG_TAG = "MSDEBroadcastReceiver"; > } > > > I verified via a logcat that my receiver is working by doing the > following in a shell > > # am broadcast -a com.test.jay > > Did I miss something? > > Thanks in advance, > Jay > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" 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-developers?hl=en -~----------~----~----~----~------~----~------~--~---

