Java Code Examples for io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding#addActivityResultListener()
The following examples show how to use
io.flutter.embedding.engine.plugins.activity.ActivityPluginBinding#addActivityResultListener() .
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: FlutterMobileVisionPlugin.java From flutter_mobile_vision with MIT License | 6 votes |
private void setup( final BinaryMessenger messenger, final Activity activity, final PluginRegistry.Registrar registrar, final ActivityPluginBinding activityBinding) { this.activity = activity; this.delegate = new FlutterMobileVisionDelegate(activity); channel = new MethodChannel(messenger, CHANNEL); channel.setMethodCallHandler(this); if (registrar != null) { // V1 embedding setup for activity listeners. registrar.addActivityResultListener(delegate); registrar.addRequestPermissionsResultListener(delegate); } else { // V2 embedding setup for activity listeners. activityBinding.addActivityResultListener(delegate); activityBinding.addRequestPermissionsResultListener(delegate); } }
Example 2
Source File: FlutterBarcodeScannerPlugin.java From flutter_barcode_scanner with MIT License | 5 votes |
/** * Setup method * Created after Embedding V2 API release * * @param messenger * @param applicationContext * @param activity * @param registrar * @param activityBinding */ private void createPluginSetup( final BinaryMessenger messenger, final Application applicationContext, final Activity activity, final PluginRegistry.Registrar registrar, final ActivityPluginBinding activityBinding) { this.activity = (FlutterActivity) activity; eventChannel = new EventChannel(messenger, "flutter_barcode_scanner_receiver"); eventChannel.setStreamHandler(this); this.applicationContext = applicationContext; channel = new MethodChannel(messenger, CHANNEL); channel.setMethodCallHandler(this); if (registrar != null) { // V1 embedding setup for activity listeners. observer = new LifeCycleObserver(activity); applicationContext.registerActivityLifecycleCallbacks( observer); // Use getApplicationContext() to avoid casting failures. registrar.addActivityResultListener(this); } else { // V2 embedding setup for activity listeners. activityBinding.addActivityResultListener(this); lifecycle = FlutterLifecycleAdapter.getActivityLifecycle(activityBinding); observer = new LifeCycleObserver(activity); lifecycle.addObserver(observer); } }
Example 3
Source File: OpenFilePlugin.java From open_file with BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public void onAttachedToActivity(ActivityPluginBinding binding) { channel = new MethodChannel( flutterPluginBinding.getBinaryMessenger(), "open_file"); context = flutterPluginBinding.getApplicationContext(); activity = binding.getActivity(); channel.setMethodCallHandler(this); binding.addRequestPermissionsResultListener(this); binding.addActivityResultListener(this); }
Example 4
Source File: FlutterBraintreePlugin.java From FlutterBraintree with MIT License | 4 votes |
@Override public void onAttachedToActivity(ActivityPluginBinding binding) { activity = binding.getActivity(); binding.addActivityResultListener(this); dropIn.onAttachedToActivity(binding); }
Example 5
Source File: FlutterBraintreePlugin.java From FlutterBraintree with MIT License | 4 votes |
@Override public void onReattachedToActivityForConfigChanges(ActivityPluginBinding binding) { activity = binding.getActivity(); binding.addActivityResultListener(this); dropIn.onReattachedToActivityForConfigChanges(binding); }
Example 6
Source File: FlutterBraintreeDropIn.java From FlutterBraintree with MIT License | 4 votes |
@Override public void onAttachedToActivity(ActivityPluginBinding binding) { activity = binding.getActivity(); binding.addActivityResultListener(this); }
Example 7
Source File: FlutterBraintreeDropIn.java From FlutterBraintree with MIT License | 4 votes |
@Override public void onReattachedToActivityForConfigChanges(ActivityPluginBinding binding) { activity = binding.getActivity(); binding.addActivityResultListener(this); }
Example 8
Source File: SocialSharePlugin.java From social_share_plugin with BSD 2-Clause "Simplified" License | 4 votes |
@Override public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { binding.addActivityResultListener(this); this.activity = binding.getActivity(); }
Example 9
Source File: SocialSharePlugin.java From social_share_plugin with BSD 2-Clause "Simplified" License | 4 votes |
@Override public void onReattachedToActivityForConfigChanges(@NonNull ActivityPluginBinding binding) { binding.removeActivityResultListener(this); binding.addActivityResultListener(this); }
Example 10
Source File: RazorpayFlutterPlugin.java From razorpay-flutter with MIT License | 4 votes |
@Override public void onAttachedToActivity(@NonNull ActivityPluginBinding binding) { this.razorpayDelegate = new RazorpayDelegate(binding.getActivity()); this.pluginBinding = binding; binding.addActivityResultListener(razorpayDelegate); }