Open a certain folder created by me on android

Asked

Viewed 349 times

1

My application creates a folder on android and on a screen want to have a button that when clicked open that folder, and only the one I specified, but so far not found anything on the subject.

  • Does the answer below resolve? Your question is not very clear, can you explain what you mean by "open" the folder? It is list the names of the files?

1 answer

2

The android features the Intent which makes these actions much easier, which would be a call from pre-defined screens/actions of android where you only specify what you want and the rest it takes care of for you, I believe your intention would be solved with just this simple code:

Uri selectedUri = Uri.parse(Environment.getExternalStorageDirectory() + "/suaPasta/");
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setDataAndType(selectedUri, "resource/folder");
startActivity(intent);

Browser other questions tagged

You are not signed in. Login or sign up in order to post.