Showing
3 changed files
with
8 additions
and
4 deletions
| @@ -29,7 +29,11 @@ import java.io.File | @@ -29,7 +29,11 @@ import java.io.File | ||
| 29 | class MobileScanner(private val activity: Activity, private val textureRegistry: TextureRegistry) | 29 | class MobileScanner(private val activity: Activity, private val textureRegistry: TextureRegistry) |
| 30 | : MethodChannel.MethodCallHandler, EventChannel.StreamHandler, PluginRegistry.RequestPermissionsResultListener { | 30 | : MethodChannel.MethodCallHandler, EventChannel.StreamHandler, PluginRegistry.RequestPermissionsResultListener { |
| 31 | companion object { | 31 | companion object { |
| 32 | - private const val REQUEST_CODE = 22022022 | 32 | + /** |
| 33 | + * When the application's activity is [androidx.fragment.app.FragmentActivity], requestCode can only use the lower 16 bits. | ||
| 34 | + * @see androidx.fragment.app.FragmentActivity.validateRequestPermissionsRequestCode | ||
| 35 | + */ | ||
| 36 | + private const val REQUEST_CODE = 0x0786 | ||
| 33 | private val TAG = MobileScanner::class.java.simpleName | 37 | private val TAG = MobileScanner::class.java.simpleName |
| 34 | } | 38 | } |
| 35 | 39 |
| @@ -5,7 +5,7 @@ | @@ -5,7 +5,7 @@ | ||
| 5 | android:label="mobile_scanner_example" | 5 | android:label="mobile_scanner_example" |
| 6 | android:icon="@mipmap/ic_launcher"> | 6 | android:icon="@mipmap/ic_launcher"> |
| 7 | <activity | 7 | <activity |
| 8 | - android:name="io.flutter.embedding.android.FlutterActivity" | 8 | + android:name=".MainActivity" |
| 9 | android:exported="true" | 9 | android:exported="true" |
| 10 | android:launchMode="singleTop" | 10 | android:launchMode="singleTop" |
| 11 | android:theme="@style/LaunchTheme" | 11 | android:theme="@style/LaunchTheme" |
| 1 | package dev.steenbakker.mobile_scanner_example | 1 | package dev.steenbakker.mobile_scanner_example |
| 2 | 2 | ||
| 3 | -import io.flutter.embedding.android.FlutterActivity | 3 | +import io.flutter.embedding.android.FlutterFragmentActivity |
| 4 | 4 | ||
| 5 | -class MainActivity: FlutterActivity() { | 5 | +class MainActivity : FlutterFragmentActivity() { |
| 6 | } | 6 | } |
-
Please register or login to post a comment