I have tried the string constant, but still not getting the broadcast. any other idea? thanks
On Jun 15, 12:25 am, Jeff Sharkey <jshar...@android.com> wrote: > You need to resolve the Java variable names to their actual String > constants when inserting into XML. For example, the below Java > variable resolves to the actual string > "android.intent.action.MEDIA_MOUNTED" which is what you would use in > the intent-filter. > > http://d.android.com/reference/android/content/Intent.html#ACTION_MED... > > j > > > > On Sun, Jun 14, 2009 at 11:34 PM, jonathan<topcod...@gmail.com> wrote: > > > I have created a BroadcastReceiver to detect SDCard mount and unmount > > event, however, I am not able to receive any events at all: > > here's the androidmanifest.xml: > > <receiver android:enabled="true" > > android:label="SDCardMountReceiver" > > android:exported="true" > > android:name="xxx.broadcasts.SDCardBroadcastReceiver"> > > <intent-filter> > > <action > > android:name="android.content.Intent.ACTION_MEDIA_MOUNTED"></action> > > <action > > android:name="android.content.Intent.ACTION_MEDIA_UNMOUNTED" /> > > > </intent-filter> > > </receiver> > > SDCardMountReceiver class: > > public class SDCardBroadcastReceiver extends BroadcastReceiver { > > public SDCardBroadcastReceiver(){ > > super(); > > System.err.println("constructor"); > > } > > > public void onReceive(Context context, Intent intent) { > > Log.d("SDCardBroadCastReceiver", "receive > > "+intent.getAction()); > > System.err.println("jonathan receive "+intent.getAction()); > > > } > > > } > > -- > Jeff Sharkey > jshar...@android.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Developers" group. To post to this group, send email to android-developers@googlegroups.com To unsubscribe from this group, send email to android-developers-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-developers?hl=en -~----------~----~----~----~------~----~------~--~---