From 9a1bc7958462916a3a643742ef672bcb8fcfe3e6 Mon Sep 17 00:00:00 2001 From: tibbi Date: Mon, 13 Jun 2016 16:34:40 +0200 Subject: [PATCH] prevent duplicate file saving --- app/src/main/java/com/simplemobiletools/draw/MainActivity.java | 2 -- 1 file changed, 2 deletions(-) diff --git a/app/src/main/java/com/simplemobiletools/draw/MainActivity.java b/app/src/main/java/com/simplemobiletools/draw/MainActivity.java index 1ab00b5..5b64dad 100644 --- a/app/src/main/java/com/simplemobiletools/draw/MainActivity.java +++ b/app/src/main/java/com/simplemobiletools/draw/MainActivity.java @@ -9,7 +9,6 @@ import android.media.MediaScannerConnection; import android.net.Uri; import android.os.Bundle; import android.os.Environment; -import android.provider.MediaStore; import android.support.v4.app.ActivityCompat; import android.support.v4.content.ContextCompat; import android.support.v4.content.FileProvider; @@ -148,7 +147,6 @@ public class MainActivity extends AppCompatActivity implements MyCanvas.PathsCha final File file = new File(directory, fileName); out = new FileOutputStream(file); bitmap.compress(Bitmap.CompressFormat.PNG, 100, out); - MediaStore.Images.Media.insertImage(getContentResolver(), file.getAbsolutePath(), file.getName(), file.getName()); MediaScannerConnection.scanFile(getApplicationContext(), new String[]{file.getAbsolutePath()}, null, null); } catch (Exception e) { Log.e(TAG, "MainActivity SaveFile " + e.getMessage());