android学习之USB监听

来源:互联网 发布:指纹充电软件下载 编辑:程序博客网 时间:2024/05/30 07:13
  IntentFilter intentFilter = newIntentFilter();
  intentFilter.addAction(Intent.ACTION_MEDIA_REMOVED);
  intentFilter.addAction(Intent.ACTION_MEDIA_EJECT);
  intentFilter.addAction(Intent.ACTION_MEDIA_UNMOUNTED);
  intentFilter.addAction(Intent.ACTION_MEDIA_MOUNTED);
  intentFilter.addDataScheme("file");
  registerReceiver(mUsbStateReceiver,intentFilter);
0 0