Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ANDROID 随系统自启动 #519

Open
pengkobe opened this issue Sep 22, 2021 · 0 comments
Open

ANDROID 随系统自启动 #519

pengkobe opened this issue Sep 22, 2021 · 0 comments

Comments

@pengkobe
Copy link
Owner

pengkobe commented Sep 22, 2021

具体需求不是简简单单的开机启动,而是需要不经过桌面直接启动,如果你有厂商的联系方式,其实还是比较好办的,直接按照教程一步一步来就 ok,他们会帮你适配。

这里列一下一般的处理步骤,具体可以参考 https://www.jianshu.com/p/92cc2b41443b

  1. 定义一个开机广播接收者 BootBroadcastReceiver
  2. 在 app 配置文件中添加权限 RECEIVE_BOOT_COMPLETED
  3. 注册广播 BOOT_COMPLETED

于此同时,也可以设置为系统桌面,在 mainactivity 的 intent-fliter 标签里添加下面的代码

<category android:name="android.intent.category.HOME" />
<category android:name="android.intent.category.DEFAULT" />

即可

参考

  1. 将某一普通应用设为桌面(launcher)的方法
  2. Cordova如何设置
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant