Aha, I found the reason, we need to register broadcast receiver as following:

MyBroadcastReceiver myReceiver = new MyBroadcastReceiver();
IntentFilter filter = new IntentFilter(Intent.ACTION_MEDIA_MOUNTED);
filter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
filter.addAction(Intent.ACTION_MEDIA_EJECT);
...
filter.addDataScheme("file"); //I forgot this line
registerReceiver(myReceiver, filter);


--- 09年3月11日,周三, Jiang <[email protected]> 写道:
发件人: Jiang <[email protected]>
主题: [android-developers] (from Jiang) How to get notification when sd card is 
inserted/mounted?
收件人: [email protected]
日期: 2009,311,周三,3:26下午

Hello guys, 
I registered a broadcast receiver with action 
android.intent.action.MEDIA_MOUNTED, but when sd card is inserted, the 
broadcast is not sent out.
Any one could help me to solve this issue? Thanks in advance.

-Jiang




        好玩贺卡等你发,邮箱贺卡全新上线!







      ___________________________________________________________ 
  好玩贺卡等你发,邮箱贺卡全新上线! 
http://card.mail.cn.yahoo.com/
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to