List of usage examples for android.provider MediaStore MEDIA_SCANNER_VOLUME
String MEDIA_SCANNER_VOLUME
To view the source code for android.provider MediaStore MEDIA_SCANNER_VOLUME.
Click Source Link
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 a va 2 s . c o m 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();// ww w . java2 s .c o m result = "external".equals(cursor.getString(0)); } cursor.close(); } return result; }
From source file:com.xmobileapp.rockplayer.RockPlayer.java
/********************************************** * //from w w w .ja va2 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; }
From source file:com.android.messaging.ui.UIIntentsImpl.java
@Override public void kickMediaScanner(final Context context, final String volume) { final Intent intent = new Intent(MEDIA_SCANNER_SCAN_ACTION) .putExtra(MediaStore.MEDIA_SCANNER_VOLUME, volume) .setClassName(MEDIA_SCANNER_PACKAGE, MEDIA_SCANNER_CLASS); context.startService(intent);//from ww w .j a v a 2 s .c o m }