gpt4 book ai didi

Android - 如何在启动后在/sdcard 上启动应用程序

转载 作者:IT老高 更新时间:2023-10-28 23:15:35 25 4
gpt4 key购买 nike

如果它在 /sdcard 上,有没有办法在启动后自动启动和启动 android 应用程序?

好的,可能是 BroadcastReceiver。但是哪个 Action 是正确的呢?

ACTION_BOOT_COMPLETED - does not work if it is on the /sdcard (documented)
ACTION_MEDIA_MOUNTED - does not work if it is on the /sdcard (which is undocumented)
ACTION_EXTERNAL_APPLICATIONS_AVAILABLE - does not work, I do not know why
ACTION_USER_PRESENT - does not work if the BroadcastReceiver is registered in AndroidManifest (which is undocumented, but documentation bug has been reported)

谢谢
一月

最佳答案

尝试使用 <receiver android:name=".BootCompleteReceiver" >
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
<action android:name="android.intent.action.QUICKBOOT_POWERON" />
</intent-filter>
</receiver>

还有这个 <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />

也许 QUICKBOOT_POWERON 可以帮助你

关于Android - 如何在启动后在/sdcard 上启动应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5741987/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com