android 应用安装完成后如何自启动?
大家讲道理
大家讲道理 2017-04-17 12:58:29
0
1
577

应用场景如下:
应用升级完成,提示安装,安装完成,如何在安装完成后自动启动?

大家讲道理
大家讲道理

光阴似箭催人老,日月如移越少年。

reply all(1)
大家讲道理

There is a prerequisite for you to do this function, that is, your application has been installed on the user’s machine. This means that you can only do this when upgrading your APK, because the function you want to perform requires your own program. Cooperate, the specific steps are as follows:

  • First of all, you need to know that the program has been installed, so you need to register a broadcast listener in your own program (it must be static, you know). The action for apk installation completion: "android.intent.action.PACKAGE_ADDED ", listen to the action in the onReceive method of this broadcast, and use the intent.getDataString() method to determine whether the package name of the installation program belongs to your own package name, and if so, do the next step;

  • Start your own program explicitly or implicitly through Intent.

Recommendation:

It’s best not to do this. You have to consider the user’s feelings, especially the automatic installation. When you don’t need to click to confirm, you are playing games, watching videos, reading novels, or using WeChat to automatically open an application. . . .

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template