handle storage permission if saving a third party intent image
This commit is contained in:
parent
76b85e611b
commit
15900f0506
|
@ -259,11 +259,13 @@ class MainActivity : SimpleActivity(), CanvasListener {
|
|||
val outputStream = contentResolver.openOutputStream(intentUri)
|
||||
saveToOutputStream(outputStream, file.getCompressionFormat())
|
||||
} else {
|
||||
handlePermission(PERMISSION_WRITE_STORAGE) {
|
||||
getFileOutputStream(file) {
|
||||
saveToOutputStream(it, file.getCompressionFormat())
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun saveToOutputStream(outputStream: OutputStream?, format: Bitmap.CompressFormat) {
|
||||
if (outputStream == null) {
|
||||
|
|
Loading…
Reference in New Issue