我想打开手机存储 emulated/storage/0/
并只过滤 pdf 文件,以便用户可以选择。
我尝试了这段代码,但在 fileChoser 中,我只能使用 DropBox
或 GoogleDrive
等第三方应用程序打开它。我如何使用 android Explorer 打开它?
addPDF.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("application/pdf");
startActivityForResult(intent,PICK_PDF_REQUEST);
}
});
编辑:我在 4.2 和 6.0 上都试过了,我在 filechooser 中唯一的选择仍然是 Drive
和 Dropbox
最佳答案
Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
intent.setType("application/pdf");
startActivityForResult(intent, SAVE_REQUEST_CODE);
关于android - 从存储中选择 pdf 文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50397948/