Home > OS >  Open the "Documents" directory of my app calling the Google Files app
Open the "Documents" directory of my app calling the Google Files app

Time:02-18

I am developing an app and I should open the "Documents" folder of the directory of my app using the Google Files app (presumably using an intent). In my app I have a recyclerView that, based on longClick event listener should open a certain directory calling the Google Files App. How can I achieve this?

CodePudding user response:

For Android 11 devices:

String folder = "Documents";

String scheme = "content://com.android.externalstorage.documents/document/primary:"   folder;

Intent intent = new Intent(Intent.ACTION_VIEW);
                                
intent.setDataAndType(Uri.parse(scheme), "vnd.android.document/root"); 

startActivity(intent );
  • Related