Android examples for android.media:Media
Returns true if uri is a media uri.
import android.provider.MediaStore; import android.provider.MediaStore; import android.util.Log; public class Main{ /**/*ww w . j a va 2s . c om*/ * Returns true if uri is a media uri. * * @param uri * @return */ public static boolean isMediaUri(String uri) { if (uri.startsWith(Audio.Media.INTERNAL_CONTENT_URI.toString()) || uri.startsWith(Audio.Media.EXTERNAL_CONTENT_URI .toString()) || uri.startsWith(Video.Media.INTERNAL_CONTENT_URI .toString()) || uri.startsWith(Video.Media.EXTERNAL_CONTENT_URI .toString())) { return true; } else { return false; } } }