From c3744e2dd003b4fa524eca6008e5e2ddfac3f212 Mon Sep 17 00:00:00 2001 From: blank X Date: Fri, 29 Apr 2022 23:17:34 +0700 Subject: [PATCH] Fix moreeee bugs --- .../java/com/blankie/fileify/PickActivity.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/src/main/java/com/blankie/fileify/PickActivity.java b/app/src/main/java/com/blankie/fileify/PickActivity.java index 36fe3c1..ca9f547 100644 --- a/app/src/main/java/com/blankie/fileify/PickActivity.java +++ b/app/src/main/java/com/blankie/fileify/PickActivity.java @@ -37,9 +37,9 @@ public class PickActivity extends Activity { startActivityForResult(newIntent, 0); } catch (ActivityNotFoundException e) { Log.e(TAG, getString(R.string.no_activity)); - Toast.makeText(getApplicationContext(), msg, Toast.LENGH_SHORT) - .show(); - setResult(Activity.RESULT_CANCELLED); + Toast.makeText(getApplicationContext(), R.string.no_activity, + Toast.LENGTH_SHORT).show(); + setResult(RESULT_CANCELED); finish(); } } @@ -52,13 +52,13 @@ public class PickActivity extends Activity { if (resultCode != RESULT_OK) { Log.d(TAG, "Received resultCode = " + resultCode); - setResult(Activity.RESULT_CANCELLED); + setResult(RESULT_CANCELED); finish(); // probably not necessary but just in case or something return; } else if (data == null) { Log.d(TAG, "Received data = null"); - setResult(Activity.RESULT_CANCELLED); + setResult(RESULT_CANCELED); finish(); return; } @@ -67,14 +67,14 @@ public class PickActivity extends Activity { intent.setFlags(Intent.FLAG_GRANT_READ_URI_PERMISSION); if (data.getData() != null) { intent.setData(data.getData()); - setResult(Activity.RESULT_OK, intent); + setResult(RESULT_OK, intent); } else if (data.getClipData() != null) { // unsafe? intent.setClipData(data.getClipData()); - setResult(Activity.RESULT_OK, intent); + setResult(RESULT_OK, intent); } else { Log.d(TAG, "Received data.getData() = null and data.getClipData() = null"); - setResult(Activity.RESULT_CANCELLED); + setResult(RESULT_CANCELED); } finish(); }