Question

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

Était-ce utile?

La 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);
   }
}
Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top