mirror of
https://github.com/johrpan/musicus_mobile.git
synced 2025-10-26 18:57:25 +01:00
Close nested writer stream
The writer function opens a nested stream that needs to be closed too. Else, we would get empty files sometimes.
This commit is contained in:
parent
87838ce7d2
commit
c5541bc391
1 changed files with 3 additions and 1 deletions
|
|
@ -232,7 +232,9 @@ class MainActivity : FlutterActivity() {
|
|||
|
||||
// TODO: Handle errors.
|
||||
val output = contentResolver.openOutputStream(uri!!)!!;
|
||||
output.writer().write(content)
|
||||
val writer = output.writer()
|
||||
writer.write(content)
|
||||
writer.close()
|
||||
output.close()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue