Whether the Uri authority is MediaProvider - Android android.net

Android examples for android.net:Uri

Description

Whether the Uri authority is MediaProvider

Demo Code

import android.annotation.SuppressLint;
import android.content.ContentResolver;
import android.content.ContentUris;
import android.content.Context;
import android.content.Intent;
import android.database.Cursor;
import android.database.DatabaseUtils;
import android.graphics.Bitmap;
import android.net.Uri;

public class Main{

    /**/*w  ww.jav a2 s . c o m*/
     * @param uri The Uri to check.
     * @return Whether the Uri authority is MediaProvider.
     * @author paulburke
     */
    public static boolean isMediaDocument(Uri uri) {
        return "com.android.providers.media.documents".equals(uri
                .getAuthority());
    }

}

Related Tutorials