Created
June 1, 2020 16:10
-
-
Save Apsaliya/5e4e3cdd6b89af948e80552f4fce2ff4 to your computer and use it in GitHub Desktop.
RestoreFile
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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