How to use Flutter Method Channel in background (app minimised/closed)
问题 I am working on a native Android widget in a Flutter App. In which there is refresh button, on click of that I have to call a method in the Flutter code. I am using Flutter Method Channel for the communication and it is working fine when app is in foreground. But it does not work when app is minimised or closed. I get error PlatformException(NO_ACTIVITY, null, null) . Below is my code. Android (AppWidgetProvider) if (methodChannel == null && context != null) { FlutterMain.startInitialization