android: Fix bug where note contents disappear if app is switched

Workaround for bug https://github.com/flutter/flutter/issues/47628
This commit is contained in:
Vishesh Handa
2020-01-25 14:05:02 +01:00
parent e3e4fa0836
commit 8587611b77
2 changed files with 6 additions and 6 deletions

View File

@ -50,6 +50,5 @@
<meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" /> <meta-data android:name="google_analytics_adid_collection_enabled" android:value="false" />
<meta-data android:name="firebase_analytics_collection_enabled" android:value="false" /> <meta-data android:name="firebase_analytics_collection_enabled" android:value="false" />
<meta-data android:name="flutterEmbedding" android:value="2" />
</application> </application>
</manifest> </manifest>

View File

@ -20,18 +20,19 @@ import io.flutter.plugin.common.MethodChannel.Result;
import io.flutter.plugins.GeneratedPluginRegistrant; import io.flutter.plugins.GeneratedPluginRegistrant;
import io.flutter.util.PathUtils; import io.flutter.util.PathUtils;
import io.flutter.embedding.android.FlutterActivity; import io.flutter.app.FlutterActivity;
import io.flutter.embedding.engine.FlutterEngine; import io.flutter.plugins.GeneratedPluginRegistrant;
public class MainActivity extends FlutterActivity implements MethodCallHandler { public class MainActivity extends FlutterActivity implements MethodCallHandler {
private static final String CHANNEL_NAME = "gitjournal.io/git"; private static final String CHANNEL_NAME = "gitjournal.io/git";
static MethodChannel channel; static MethodChannel channel;
@Override @Override
public void configureFlutterEngine(@NonNull FlutterEngine flutterEngine) { protected void onCreate(Bundle savedInstanceState) {
GeneratedPluginRegistrant.registerWith(flutterEngine); super.onCreate(savedInstanceState);
GeneratedPluginRegistrant.registerWith(this);
channel = new MethodChannel(flutterEngine.getDartExecutor().getBinaryMessenger(), CHANNEL_NAME); channel = new MethodChannel(getFlutterView(), CHANNEL_NAME);
channel.setMethodCallHandler(this); channel.setMethodCallHandler(this);
} }