1.前言
有些客戶使用的應用并不帶有自動監聽U盤 sd卡廣播的代碼,使用的代碼是固定的地址,這樣的話,就需要我們將系統的掛載目錄固定了。
原始路徑 /storage/3123-19FA
增加鏈接 /storage/upan_000 -> /storage/3123-19FA
2. 首先如果是應用本身監聽的話,使用的是
// 監聽廣播
private final BroadcastReceiver mSDReceiver = new BroadcastReceiver() {@Overridepublic void onReceive(Context context, Intent intent) {String action = intent.getAction();switch (action) {case Intent.ACTION_MEDIA_MOUNTED://SD卡掛載成功android.util.Log.e("maxx","mSDReceiver mounted");break;case Intent.ACTION_MEDIA_UNMOUNTED://SD卡卸載成功android.util.Log.e("maxx","mSDReceiver eject");break;default: