大家好,又见面了,我是全栈君。
眼下最完整的,须要注冊的动作匹配例如以下:
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);
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/115518.html原文链接:https://javaforall.net