简体   繁体   English

如何从 MainActivity.java 启动 Flutter App

[英]How to launch Flutter App from MainActivity.java

I have created app.我已经创建了应用程序。 I want to run app when device is restart\turned on.我想在设备重新启动\打开时运行应用程序。 So I implemented the functionality in native code.所以我在本机代码中实现了该功能。 Now the native code is calling the MainActivity class when device is restarted.现在,当设备重新启动时,本机代码正在调用 MainActivity class。 Now I want to make a function in MainActivity which will launch my app.现在我想在 MainActivity 中创建一个 function 来启动我的应用程序。 Something Like I call main() method of main.dart file from MainActivity.java.就像我从 MainActivity.java 调用main.dart文件的main()方法一样。

If anybody know then kindly answer this question.如果有人知道,请回答这个问题。

Could you just create a Flutter project and add your native part in MainActivity.java?您可以创建一个 Flutter 项目并将您的原生部分添加到 MainActivity.java 中吗?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM