将开发过程常用的内容段做个收藏,下边资料是关于Android系统下监听SD卡的插入并读取内容的内容。
private final BroadcastReceiver broadcastRec = new BroadcastReceiver() {
@Override
public void onReceive(Context context, Intent intent) {
{
}
||intent.getAction().equals("android.intent.action.ACTION_MEDIA_UNMOUNTED")
||intent.getAction().equals("android.intent.action.ACTION_MEDIA_BAD_REMOVAL"))
{
}
}
};
IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MEDIA_MOUNTED);
intentFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
intentFilter.addAction(Intent.ACTION_MEDIA_REMOVED);
intentFilter.addAction(Intent.ACTION_MEDIA_BAD_REMOVAL);
intentFilter.addDataScheme("file");
网友评论