OpenFileActivityOptions
Stay organized with collections
Save and categorize content based on your preferences.
Options used to configure settings for the open file dialog activity. Using these options,
search results of a user's Drive can be filtered for a faster experience and more narrow
results.
To create the open file dialog activity with a specified configuration, pass the options
to newOpenFileActivityIntentSender(OpenFileActivityOptions)
. The returned IntentSender
can be used to create an activity that will display all files and folder from the user's
Drive, including those that the calling application does not have explicit authorization to
access.
Once the user selects a file to open, the calling application is given access to that
file.
Nested Class Summary
class
Builder used to create a new instance of OpenFileActivityOptions
.
Inherited Method Summary
From class java.lang.Object
Constants
The ID to get access to the selected DriveId
.
Constant Value:
"response_drive_id"
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License
, and code samples are licensed under the Apache 2.0 License
. For details, see the Google Developers Site Policies
. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-10-31 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-10-31 UTC."],[[["\u003cp\u003e\u003ccode\u003eOpenFileActivityOptions\u003c/code\u003e configures settings for the Android open file dialog, enabling Drive search filtering for a streamlined user experience.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can use these options to create an activity that displays files and folders from the user's Drive, even those without explicit app authorization.\u003c/p\u003e\n"],["\u003cp\u003eUpon file selection, the calling application gains access to the chosen file.\u003c/p\u003e\n"],["\u003cp\u003e\u003ccode\u003eOpenFileActivityOptions\u003c/code\u003e utilizes a builder pattern for instantiation and offers an \u003ccode\u003eEXTRA_RESPONSE_DRIVE_ID\u003c/code\u003e constant for accessing the selected Drive ID.\u003c/p\u003e\n"]]],["`OpenFileActivityOptions` configures the open file dialog, allowing filtered searches of a user's Drive. Options are passed to `newOpenFileActivityIntentSender` to create the dialog activity, which displays all files, even without explicit access. Upon user selection, the application gains access to the chosen file. The `EXTRA_RESPONSE_DRIVE_ID` constant provides the selected `DriveId`. The class includes a Builder for creating instances and inherits methods from `java.lang.Object`.\n"],null,["# OpenFileActivityOptions\n\npublic final class **OpenFileActivityOptions** extends [Object](//developer.android.com/reference/java/lang/Object.html) \nOptions used to configure settings for the open file dialog activity. Using these options,\nsearch results of a user's Drive can be filtered for a faster experience and more narrow\nresults.\n\nTo create the open file dialog activity with a specified configuration, pass the options\nto [newOpenFileActivityIntentSender(OpenFileActivityOptions)](/android/reference/com/google/android/gms/drive/DriveClient#newOpenFileActivityIntentSender(com.google.android.gms.drive.OpenFileActivityOptions)). The returned\n[IntentSender](//developer.android.com/reference/android/content/IntentSender.html)\ncan be used to create an activity that will display all files and folder from the user's\nDrive, including those that the calling application does not have explicit authorization to\naccess.\n\nOnce the user selects a file to open, the calling application is given access to that\nfile. \n\n### Nested Class Summary\n\n|-------|---|---|---------------------------------------------------------------------|\n| class | [OpenFileActivityOptions.Builder](/android/reference/com/google/android/gms/drive/OpenFileActivityOptions.Builder) || Builder used to create a new instance of `OpenFileActivityOptions`. |\n\n### Constant Summary\n\n|-------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------------------------|----------------------------------------------------------------------------------------------------------|\n| [String](//developer.android.com/reference/java/lang/String.html) | [EXTRA_RESPONSE_DRIVE_ID](/android/reference/com/google/android/gms/drive/OpenFileActivityOptions#EXTRA_RESPONSE_DRIVE_ID) | The ID to get access to the selected [DriveId](/android/reference/com/google/android/gms/drive/DriveId). |\n\n### Inherited Method Summary\n\nFrom class java.lang.Object \n\n|----------------------------------------------------------------------------|--------------------------------------------------------------------------------|\n| [Object](//developer.android.com/reference/java/lang/Object.html) | clone() |\n| boolean | equals([Object](//developer.android.com/reference/java/lang/Object.html) arg0) |\n| void | finalize() |\n| final [Class](//developer.android.com/reference/java/lang/Class.html)\\\u003c?\\\u003e | getClass() |\n| int | hashCode() |\n| final void | notify() |\n| final void | notifyAll() |\n| [String](//developer.android.com/reference/java/lang/String.html) | toString() |\n| final void | wait(long arg0, int arg1) |\n| final void | wait(long arg0) |\n| final void | wait() |\n\nConstants\n---------\n\n#### public static final [String](//developer.android.com/reference/java/lang/String.html)\n**EXTRA_RESPONSE_DRIVE_ID**\n\nThe ID to get access to the selected [DriveId](/android/reference/com/google/android/gms/drive/DriveId). \nConstant Value: \"response_drive_id\""]]