Search code examples
androidgoogle-drive-android-api

Why are no Thumbnails Shown in Google Drive OpenFileActivity?


I request display of the Android Google Drive API OpenFileActivity using the following code, which differs only in MIME type from the example code of the Drive API for Android demo.

IntentSender intentSender =
        Drive.DriveApi
            .newOpenFileActivityBuilder()
            .setActivityTitle("Choose Image")
            .setMimeType(new String[]{"image/jpeg"})
            .build(getGoogleApiClient());
try {
    mActivity.startIntentSenderForResult(
            intentSender, Params.RC_PICK_GDRIVE_IMAGE, null, 0, 0, 0);
} catch (SendIntentException e) {
    Log.w(TAG, "Failed to send intent:" + e.getMessage());
}

Using this code, the activity opens and contains the expected content, but there are no thumbnails shown for the listed image files. Instead of a thumbnail, an icon with red background and the white outline of mountain peaks(?) is displayed. Are there other configuration parameters I need to set to see thumbnails? I expected thumbnails because that seems to be the standard style for image chooser UIs. For example, the document picker of the Storage Access Framework (SAF) and the Dropbox chooser both include thumbnails. It's odd that a thumbnail is displayed with Google Drive image files in the SAF document picker, but not in the Google Drive OpenFileActivity.

I've done my testing using Play Services 7.5 on devices running KitKat and Lollipop.


Solution

  • We have not yet implemented thumbnails in the Drive API file picker, for any mime type.

    If this is a feature you want, it would be worth making a feature request.