Skip to content

Instantly share code, notes, and snippets.

@DivS-15
Created August 17, 2022 16:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DivS-15/890aa003b697efa3fca0b44343026b49 to your computer and use it in GitHub Desktop.
Save DivS-15/890aa003b697efa3fca0b44343026b49 to your computer and use it in GitHub Desktop.
import android.content.Context
import android.content.Intent
import androidx.activity.result.contract.ActivityResultContracts
class MyOpenDocumentContract : ActivityResultContracts.OpenDocument() {
override fun createIntent(context: Context, input: Array<String>): Intent {
val intent = super.createIntent(context, input)
intent.addCategory(Intent.CATEGORY_OPENABLE)
return intent
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment