Skip to content

Commit a5c87f5

Browse files
authored
Replace getExternalStorageDirectory function call with getExternalFilesDir call since the first one is deprecated in API level 29.
1 parent fe9920f commit a5c87f5

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

android/src/main/java/com/rssignaturecapture/RSSignatureCaptureMainView.java

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
import android.content.Context;
2020
import android.graphics.Bitmap;
2121
import android.graphics.Color;
22-
import android.os.Environment;
2322
import android.view.View;
2423
import android.view.View.OnClickListener;
2524
import android.widget.Button;
@@ -138,11 +137,8 @@ else if (tag.equalsIgnoreCase("Reset")) {
138137
* save the signature to an sd card directory
139138
*/
140139
final void saveImage() {
141-
142-
String root = Environment.getExternalStorageDirectory().toString();
143-
144140
// the directory where the signature will be saved
145-
File myDir = new File(root + "/saved_signature");
141+
File myDir = getContext().getExternalFilesDir("/saved_signature");
146142

147143
// make the directory if it does not exist yet
148144
if (!myDir.exists()) {

0 commit comments

Comments
 (0)