Last active
May 13, 2023 08:29
-
-
Save sergicastellsague/e48dc1d0dafbb853ae2e8a50b25f258b to your computer and use it in GitHub Desktop.
Belongs to medium article
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class MainActivity : FlutterActivity() { | |
override fun onCreate(savedInstanceState: Bundle?) { | |
super.onCreate(savedInstanceState) | |
GeneratedPluginRegistrant.registerWith(this) | |
MethodChannel(flutterView, "android_app_retain").apply { | |
setMethodCallHandler { method, result -> | |
if (method.method == "sendToBackground") { | |
moveTaskToBack(true) | |
} | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
this was wrong, causing to use for new comer user. the code was not work at all