From 0b895e8d6fe3a4d27a10637234fa0cc706e5cfe5 Mon Sep 17 00:00:00 2001 From: Reuben Mangubat Date: Wed, 3 Mar 2021 18:28:43 +0800 Subject: [PATCH] Use context instead of activity from Plugin --- .../org/idpass/smartscanner/capacitor/SmartScannerPlugin.kt | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/android/src/main/java/org/idpass/smartscanner/capacitor/SmartScannerPlugin.kt b/android/src/main/java/org/idpass/smartscanner/capacitor/SmartScannerPlugin.kt index 889aa9d..6a1de78 100644 --- a/android/src/main/java/org/idpass/smartscanner/capacitor/SmartScannerPlugin.kt +++ b/android/src/main/java/org/idpass/smartscanner/capacitor/SmartScannerPlugin.kt @@ -24,8 +24,7 @@ class SmartScannerPlugin : Plugin() { saveCall(call) if (action == "START_SCANNER") { Timber.d("executeScanner %s", action) - val activity: Activity = activity - val intent = Intent(activity, SmartScannerActivity::class.java) + val intent = Intent(context, SmartScannerActivity::class.java) val scannerOptions = Gson().fromJson(options.toString(), ScannerOptions::class.java) intent.putExtra(SmartScannerActivity.SCANNER_OPTIONS, scannerOptions) startActivityForResult(call, intent, REQUEST_OP_SCANNER)