android点滴之标准SD卡状态变化事件广播接收者的注冊

眼下最完整的,须要注冊的动作匹配例如以下:

IntentFilter intentFilter = new IntentFilter(Intent.ACTION_MEDIA_MOUNTED);
        intentFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
        intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_STARTED);
        intentFilter.addAction(Intent.ACTION_MEDIA_SCANNER_FINISHED);
        intentFilter.addAction(Intent.ACTION_MEDIA_CHECKING);
        intentFilter.addAction(Intent.ACTION_MEDIA_BAD_REMOVAL);
        intentFilter.addDataScheme("file");
        mContext.registerReceiver(mMediaReceiver, intentFilter);   


posted @ 2016-04-01 13:10  yxwkaifa  阅读(262)  评论(0编辑  收藏  举报