Search code examples
androidandroid-intentmime-typestruetype

Android: Correct MIME type to select ttf font in SAF


I am trying to send intent to open a ttf file in SAF like this. I doesn't work.

            Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
            intent.setType("application/x-font-ttf");
            startActivityForResult(intent, FONT_SELECT_CODE);

Is there a MIME type for ttf files, or can I create a custom one?


Solution

  • Apparently it didn't work at the time I posted this question, but "application/x-font-ttf" is the correct mime-type and works now.