public class

OpenFileActivityBuilder

extends Object
java.lang.Object
   ↳ com.google.android.gms.drive.OpenFileActivityBuilder

Class Overview

A builder that is used to configure and display the open file activity. This activity displays files and folders from the user's Drive. The activity can be used to display all files in the Drive, not just those your application has access to. Your application will be given access to the selected file.

To display the activity, pass the result of build(GoogleApiClient) to #startIntentSenderForResult(). When the activity completes, a successful response will include an extra EXTRA_RESPONSE_DRIVE_ID with the selected DriveId.

Note: you cannot use #startActivity to invoke the activity. This will fail.

Summary

Constants
String EXTRA_RESPONSE_DRIVE_ID A successful result will return an extra by this name which will contain the DriveId of the selected file.
Public Methods
IntentSender build(GoogleApiClient apiClient)
Builds an IntentSender from the builder attributes that can be used to start the Open File activity using startIntentSenderForResult(IntentSender, int, Intent, int, int, int).
OpenFileActivityBuilder setActivityStartFolder(DriveId folder)
Sets the folder that the Activity will display initially.
OpenFileActivityBuilder setActivityTitle(String title)
Sets the title displayed in the activity.
OpenFileActivityBuilder setMimeType(String[] mimeTypes)
Sets the MIME type filter which controls which kinds of files can be selected from the file picker.
[Expand]
Inherited Methods
From class java.lang.Object

Constants

public static final String EXTRA_RESPONSE_DRIVE_ID

A successful result will return an extra by this name which will contain the DriveId of the selected file.

Constant Value: "response_drive_id"

Public Methods

public IntentSender build (GoogleApiClient apiClient)

Builds an IntentSender from the builder attributes that can be used to start the Open File activity using startIntentSenderForResult(IntentSender, int, Intent, int, int, int).

Parameters
apiClient The GoogleApiClient to service the call. The client must be connected before invoking this method.

public OpenFileActivityBuilder setActivityStartFolder (DriveId folder)

Sets the folder that the Activity will display initially. If not specified, it will default to the root of "My Drive".

public OpenFileActivityBuilder setActivityTitle (String title)

Sets the title displayed in the activity.

Parameters
title the title to set on the activity (may not be null)

public OpenFileActivityBuilder setMimeType (String[] mimeTypes)

Sets the MIME type filter which controls which kinds of files can be selected from the file picker. If this method is not called or if a zero-length array is provided, all non-folder files will be selectable.

Parameters
mimeTypes the mime types to show in the picker. May not be null. If a zero-length array is provided, all non-folder files will be selectable