this is a asked question but i did not solve it using that solution. Here is my code
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
Uri uri = Uri.parse(Environment.getDownloadCacheDirectory().getPath().toString());
intent.setDataAndType(uri,"*/*");
intent.putExtra(Intent.EXTRA_LOCAL_ONLY, true);
intent.addCategory(Intent.CATEGORY_OPENABLE);
try {
startActivityForResult(Intent.createChooser(intent, "SELECT FILE"), commonUtilities.FILE_REQUEST_CODE);
} catch (ActivityNotFoundException e) {
}
Still Google drive options is there. I just want not to display the google drive option.
How can i get that , Help me out. Thank in adv
I just want not to display the google drive option.
What you want is not important. What your users want is important. Some of your users may want to get content from Google Drive, file servers on the local network, and other places that they have configured on their device that support ACTION_GET_CONTENT
.
Beyond that, in general, you cannot control what options ACTION_GET_CONTENT
provides to users.
So, if you do not want Google Drive to appear as an option, do not use ACTION_GET_CONTENT
(or ACTION_OPEN_DOCUMENT
, ACTION_CREATE_DOCUMENT
, etc.). Do something else, such as integrate a file-picker library.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With