I want in my Android app to choose Google Docs file that is kept on Google Drive and after that - to read some data from it (but it's out of this question's scope). So for the start I just want to click on that file and get some callback. I follow this recommendations on Google Drive Android API Deprecation and migration to Google Drive Rest API.
I managed to get dialog with list of Google Drive's files, but I can't choose Google Docs files (I can see them but they are not active to click on them). At the same time I can choose another types of files - for example, PDF, PNG, if I set their MIME-type.
For now I use this piece of code:
val pickerIntent = Intent(Intent.ACTION_OPEN_DOCUMENT)
pickerIntent.addCategory(Intent.CATEGORY_OPENABLE)
pickerIntent.type = "*/*"
val mimeTypes = arrayOf(
"application/pdf", // works
"image/png", //works
// none of MIME below works
"application/vnd.openxmlformats-officedocument.wordprocessingml.document",
"application/vnd.google-apps.document",
"application/vnd.google-apps.file"
)
pickerIntent.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes)
In the official sample they used MIME "text/plain" as an example, so it's of no help to me.
I tried several MIME-types I could find (here and here for example), but all of them haven't fixed problem.
What MIME-type should be used for this? Or maybe problem is not in MIME-type?