glei
glei

Reputation: 83

How can I open file location to show a file?

I am making video player app. And I want to add option like, when user taps,it opens default file manager to show this video file's location.

Here is sample from Windows OS enter image description here

Any help would be appreciated !

Upvotes: 0

Views: 125

Answers (1)

Harsh Arjeria
Harsh Arjeria

Reputation: 76

You can do this by this method.

public void open_Folder(String location)
{
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
Uri uri = Uri.parse(Environment.getExternalStorageDirectory().getPath()
     + File.separator+ location + File.separator);
intent.setDataAndType(uri, "set your data type");
startActivity(Intent.createChooser(intent, "Select file manager app."));
}

Upvotes: 1

Related Questions