如何设置 Intent 类型,使其仅显示.db 文件。 sqlite sb 的 mimetype 是什么?我已经尝试过这个问题的解决方案Android: what is the mime type to use if I want to see/pick a SQLite database from the Downloads folder?但不工作。
目前,我正在这样做:
Intent newIntent = new Intent(Intent.ACTION_GET_CONTENT);
newIntent.setType("application/vnd.sqlite3");
newIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
newIntent.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION);
startActivityForResult(newIntent,FILE_PICKER_REQUEST_CODE);
但它显示所有类型的文件
最佳答案
关于android - 如何在android中使用intent仅选择sqlite db文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65211402/