How to open the file browser in an Android app?

0

Greetings

I have an android application to download files, the problem is that I need to download the file there will be the system's default file browser in the folder where my file is downloaded so that the user can view your file.

The problem is not the download , since the application is responsible for downloading it and if I go to the file browser manually there it is.

    
asked by Enmanuel Pascual Jimenez Guzma 20.07.2017 в 17:14
source

1 answer

1

You could try an Intent

public void openFolder(){
    Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
    Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath()
         + "/myFolder/");
    intent.setDataAndType(uri, "text/csv");
    startActivity(Intent.createChooser(intent, "Open folder"));
}
    
answered by 20.07.2017 в 17:16