Question

My Android Device contains Default File Manager and a Button (Open). How to open the file manager when I click the button?

Was it helpful?

Solution

Try something like this in your button listener:

openButton.setOnClickListener(new OnClickListener() {

   @Override
   public void onClick(View v) {
      Intent intent = new Intent();
      intent.setAction(Intent.ACTION_GET_CONTENT);
      intent.setType("file/*");
      startActivity(intent);
   }
}
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top