Open Default File Manager in android?

我只是一个虾纸丫 提交于 2019-12-01 07:10:37

问题


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


回答1:


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);
   }
}


来源:https://stackoverflow.com/questions/11720032/open-default-file-manager-in-android

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!