Open special file types/extensions in Jetpack Compose

23 Views Asked by At

I want to open special file types with extension like ".d83" (plain text), ".x83" (special XML) in Jetpack Compose. I don't see how to do that in androidx.activity.compose.rememberLauncherForActivityResult.

1

There are 1 best solutions below

0
CommonsWare On

That is not directly supported in Android. Jetpack Compose does not improve the situation.

If you wish to use platform-supplied things like ActivityResultContracts.OpenDocument, you will need to let users open files of any MIME type (*/*), then inspect the contents to see if they are formatted as you expect.