is MediaStore Image Uri - Android Media

Android examples for Media:Picture

Description

is MediaStore Image Uri

Demo Code


//package com.java2s;

import android.net.Uri;

import android.provider.MediaStore.Images;

public class Main {
    public static boolean isImageUri(Uri uri) {
        if (uri == null) {
            return false;
        }/*from ww  w .j a v  a2  s.  c  o m*/
        String uriStr = uri.toString();
        return uriStr.startsWith(Images.Media.EXTERNAL_CONTENT_URI
                .toString())
                || uriStr.startsWith(Images.Media.INTERNAL_CONTENT_URI
                        .toString());
    }
}

Related Tutorials