首页 > 解决方案 > 意图选择文件 - 如何将类型设置为 .keystore?

问题描述

我正在尝试使用 Intent 选择文件.ACTION_GET_CONTENT

Intent chooseFile = new Intent(Intent.ACTION_GET_CONTENT);
chooseFile.setType("*/*");
chooseFile = Intent.createChooser(chooseFile, "Select keystore");
startActivityForResult(chooseFile, 1001);

这将显示所有可供选择的文件。

有了这个答案:

intent.setType(type) 可能的意图类型是什么?

它显示了我可以为 Intent 设置的文件类型列表,但是我找不到仅选择.keystore文件的选项(用于加密钱包)。

我将如何将该类型添加为意图?

标签: androidandroid-intentandroid-afilechooser

解决方案


推荐阅读