Android系统下监听SD卡的插入并读取内容的代码
作者:互联网
将开发过程常用的内容段做个收藏,下边资料是关于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");
标签:addAction,MEDIA,intentFilter,Intent,ACTION,intent,Android,监听,SD 来源: https://blog.csdn.net/weixin_44099735/article/details/121157084