Example usage for android.provider DocumentsContract getDocumentThumbnail

List of usage examples for android.provider DocumentsContract getDocumentThumbnail

Introduction

In this page you can find the example usage for android.provider DocumentsContract getDocumentThumbnail.

Prototype

@UnsupportedAppUsage
public static Bitmap getDocumentThumbnail(ContentProviderClient client, Uri documentUri, Point size,
        CancellationSignal signal) throws RemoteException, IOException 

Source Link

Usage

From source file:org.sufficientlysecure.keychain.util.FileHelper.java

/**
 * Retrieve thumbnail of file, document api feature and thus KitKat only
 *///  ww  w  . j av a2 s.  c  o  m
public static Bitmap getThumbnail(Context context, Uri uri, Point size) {
    if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
        return DocumentsContract.getDocumentThumbnail(context.getContentResolver(), uri, size, null);
    } else {
        return null;
    }
}