我正在开发一个应用程序,我希望在从 Google Play 商店安装该应用程序后自动启动该应用程序。我对此进行了一些搜索,发现线程和答案表明无法完成此操作。 但我还在 Play 商店上找到了一个应用程序,Auto Launch when Installed这非常有效。 谁能告诉我这背后的逻辑。任何帮助将不胜感激。
最佳答案
您需要创建一个绑定(bind)到 BOOT_COMPLETED 操作。
示例
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.alfray.timeriffic" ...>
<application ...>
<receiver android:name=".MyBroadcastReceiver">
<intent-filter>
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
</receiver>
</application>
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" />
</manifest>
它可能会起作用。试试看
关于android - 安装后自动启动应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13190327/