0

I'm trying to select a file using the Intent .ACTION_GET_CONTENT

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

This displays all files to select from.

With this SO answer:

What are the possible intent types for intent.setType(type)?

It displays a list of file types that I can set for the Intent, however I can't find an option for selecting only a .keystore file (for a crypto wallet).

How would I add that type as the intent?

DIRTY DAVE
  • 2,523
  • 2
  • 20
  • 83
  • 1
    I do not see signs of there being a MIME type for that. And, even if there were one, I expect that few Android devices would be set up to recognize that MIME type. Most likely `*/*` is as good as you are going to get. – CommonsWare Nov 06 '21 at 20:36
  • I found this list of media types ```https://www.iana.org/assignments/media-types/media-types.xhtml```. Does this mean all these MIME types are supported by Android that I can set the Type as? I'm not sure – DIRTY DAVE Nov 06 '21 at 20:39
  • 1
    "Does this mean all these MIME types are supported by Android that I can set the Type as?" -- not necessarily. First, the list that you cited is updated from time to time, but Android devices rarely get OS updates. Second, I don't know that Google commits to supporting all those MIME types even on newer versions of Android. – CommonsWare Nov 06 '21 at 20:43
  • Ah okay, thanks! – DIRTY DAVE Nov 06 '21 at 20:44

0 Answers0