List of usage examples for android.provider MediaStore getMediaScannerUri
public static Uri getMediaScannerUri()
From source file:Main.java
public static boolean isMediaScannerScanning(Context context) { boolean result = false; Cursor cursor = query(context, MediaStore.getMediaScannerUri(), new String[] { MediaStore.MEDIA_SCANNER_VOLUME }, null, null, null); if (cursor != null) { if (cursor.getCount() == 1) { cursor.moveToFirst();// ww w . j av a 2 s . c om result = "external".equals(cursor.getString(0)); } cursor.close(); } return result; }
From source file:Main.java
public static boolean isMediaScannerScanning(Context context) { boolean result = false; Cursor cursor = query(context, MediaStore.getMediaScannerUri(), new String[] { MediaStore.MEDIA_SCANNER_VOLUME }, null, null, null); if (cursor != null) { if (cursor.getCount() == 1) { cursor.moveToFirst();/*from w w w . ja v a2s .co m*/ result = "external".equals(cursor.getString(0)); } cursor.close(); } return result; }
From source file:com.xmobileapp.rockplayer.RockPlayer.java
/********************************************** * // w w w . j a v a 2 s .c o m * External function from MusicUtils.java of * Android's Music App * * --- still needs to be tested * **********************************************/ public boolean isMediaScannerScanning(Context context, ContentResolver contentResolver) { boolean result = false; Cursor cursor = contentResolver.query(MediaStore.getMediaScannerUri(), new String[] { MediaStore.MEDIA_SCANNER_VOLUME }, null, null, null); if (cursor != null) { if (cursor.getCount() == 1) { cursor.moveToFirst(); result = "external".equals(cursor.getString(0)); } cursor.close(); } return result; }