From a7082b3fb4036ba5a7ca0436f333d81f0743e7f5 Mon Sep 17 00:00:00 2001 From: Tafel <35837839+tafelnl@users.noreply.github.com> Date: Fri, 11 Jun 2021 16:32:16 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20fix=20#46=20(#47)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../capacitor/barcodescanner/BarcodeScanner.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/android/src/main/java/com/dutchconcepts/capacitor/barcodescanner/BarcodeScanner.java b/android/src/main/java/com/dutchconcepts/capacitor/barcodescanner/BarcodeScanner.java index 6dd1d37..878397e 100644 --- a/android/src/main/java/com/dutchconcepts/capacitor/barcodescanner/BarcodeScanner.java +++ b/android/src/main/java/com/dutchconcepts/capacitor/barcodescanner/BarcodeScanner.java @@ -3,6 +3,7 @@ import static android.content.Context.MODE_PRIVATE; import android.Manifest; +import android.app.Activity; import android.content.Intent; import android.content.SharedPreferences; import android.content.pm.PackageManager; @@ -14,12 +15,14 @@ import android.util.Log; import android.view.ViewGroup; import android.widget.FrameLayout; +import androidx.activity.result.ActivityResult; import com.getcapacitor.JSArray; import com.getcapacitor.JSObject; import com.getcapacitor.PermissionState; import com.getcapacitor.Plugin; import com.getcapacitor.PluginCall; import com.getcapacitor.PluginMethod; +import com.getcapacitor.annotation.ActivityCallback; import com.getcapacitor.annotation.CapacitorPlugin; import com.getcapacitor.annotation.Permission; import com.getcapacitor.annotation.PermissionCallback; @@ -462,6 +465,10 @@ public void openAppSettings(PluginCall call) { Intent intent = new Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.fromParts("package", getAppId(), null)); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); startActivityForResult(call, intent, "openSettingsResult"); + } + + @ActivityCallback + private void openSettingsResult(PluginCall call, ActivityResult result) { call.resolve(); } }