Skip to content

Commit 83808a3

Browse files
committed
fix: 🐛 Add enable-software-rendering tag for example app
1 parent 17085e7 commit 83808a3

File tree

1 file changed

+10
-0
lines changed
  • example/android/app/src/main/java/com/example/flutter_serial_port_example

1 file changed

+10
-0
lines changed

example/android/app/src/main/java/com/example/flutter_serial_port_example/MainActivity.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,22 @@
11
package com.example.flutter_serial_port_example;
22

33
import android.os.Bundle;
4+
import android.os.Build;
5+
import android.util.Log;
6+
47
import io.flutter.app.FlutterActivity;
58
import io.flutter.plugins.GeneratedPluginRegistrant;
69

710
public class MainActivity extends FlutterActivity {
811
@Override
912
protected void onCreate(Bundle savedInstanceState) {
13+
14+
Log.d("MainActivity", "VERSION.SDK_INT: " + Build.VERSION.SDK_INT);
15+
if (Build.VERSION.SDK_INT <= Build.VERSION_CODES.KITKAT_WATCH) {
16+
// use software rendering (ideally only when you need to)
17+
getIntent().putExtra("enable-software-rendering", true);
18+
}
19+
1020
super.onCreate(savedInstanceState);
1121
GeneratedPluginRegistrant.registerWith(this);
1222
}

0 commit comments

Comments
 (0)