Created
June 1, 2020 15:49
-
-
Save Apsaliya/dcaa9cd02fca94b0dd5c3246ab70f59f to your computer and use it in GitHub Desktop.
Create backup file in external storage
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 onLocalBackupRequested(activity: Activity) { | |
val mimeTypes = arrayOf("application/zip") | |
val fn = getBackupFileName(prefix) | |
val intent = Intent(Intent.ACTION_CREATE_DOCUMENT) | |
.addCategory(Intent.CATEGORY_OPENABLE) | |
.setType("application/zip") | |
.putExtra(Intent.EXTRA_MIME_TYPES, mimeTypes) | |
.putExtra( | |
Intent.EXTRA_TITLE, fn | |
) | |
activity.startActivityForResult(intent, 695) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment