File tree Expand file tree Collapse file tree 1 file changed +2
-1
lines changed
app/src/main/java/com/amrdeveloper/linkhub/ui/importexport Expand file tree Collapse file tree 1 file changed +2
-1
lines changed Original file line number Diff line number Diff line change @@ -79,7 +79,7 @@ class ImportExportViewModel @Inject constructor(
7979 fileType : ImportExportFileType ,
8080 data : String
8181 ) {
82- val fileName = System .currentTimeMillis().toString() + fileType.extension
82+ val fileName = " linkhub_ ${ System .currentTimeMillis().toString() + fileType.extension} "
8383 if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .Q ) {
8484 val resolver = context.contentResolver
8585 val values = ContentValues ()
@@ -92,6 +92,7 @@ class ImportExportViewModel @Inject constructor(
9292 val uri = resolver.insert(MediaStore .Downloads .EXTERNAL_CONTENT_URI , values)
9393 val outputStream = uri?.let { resolver.openOutputStream(it) }
9494 outputStream?.write(data.toByteArray())
95+ outputStream?.close()
9596 } else {
9697 val downloadDir =
9798 Environment .getExternalStoragePublicDirectory(Environment .DIRECTORY_DOWNLOADS )
You can’t perform that action at this time.
0 commit comments