2015-04-18 137 views

回答

2

我得到了它,下面的代碼將掃描圖像文件,並使其可同時使用畫廊還:

MediaScannerConnection.scanFile(context, 
      new String[] { file.toString() }, null, 
      new MediaScannerConnection.OnScanCompletedListener() { 
     public void onScanCompleted(String path, Uri uri) { 
      Log.i("ExternalStorage", "Scanned " + path + ":"); 
      Log.i("ExternalStorage", "-> uri=" + uri); 
     } 
    }); 
相關問題