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="firebase_analytics_collection_enabled" android:value="false" />
<meta-data android:name="flutterEmbedding" android:value="2" />
</application>
</manifest>

View File

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