How to open the "My Files/File Manager" in Android Programmatically (using Intent) in Android 12 - Snow Cone?

320 Views Asked by At

How to open My Files/File Manager folder in Android Programmatically (using intent) in Android 12 - Snow Cone? I am using the below code snippet which opens up the File Manager in Android 11(Red Velvet Cake), I want the My Files folder to get open programmatically in Android 12(Snow Cone), please let me know if there are any specific intent parameters I need to pass to get the File Manager open in Android 12.

        Intent chooserIntent;
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
            chooserIntent = new Intent(Intent.ACTION_PICK, 
            MediaStore.Images.Media.EXTERNAL_CONTENT_URI);
            chooserIntent.setType("*/*"); 
        }else {
            chooserIntent = new Intent(Intent.ACTION_GET_CONTENT);
            chooserIntent.setType("*/*");
            chooserIntent.addCategory(Intent.CATEGORY_OPENABLE);
        }

Thanks :)

0

There are 0 best solutions below