Skip to content

Instantly share code, notes, and snippets.

@Apsaliya
Created June 1, 2020 16:10
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 Apsaliya/5e4e3cdd6b89af948e80552f4fce2ff4 to your computer and use it in GitHub Desktop.
Save Apsaliya/5e4e3cdd6b89af948e80552f4fce2ff4 to your computer and use it in GitHub Desktop.
RestoreFile
fun onLocalRestoreRequested(activity: Activity) {
val mimeTypes = arrayOf("application/zip", "application/octet-stream", "application/x-zip-compressed", "multipart/x-zip")
val intent = Intent(Intent.ACTION_OPEN_DOCUMENT)
.addCategory(Intent.CATEGORY_OPENABLE)
.setType("*/*")
.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes)
.addFlags(Intent.FLAG_GRANT_PERSISTABLE_URI_PERMISSION)
.addFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION)
activity.startActivityForResult(intent, 696)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment