[英]Eclipse auto delete apk after install apk
my system will open the installation if user click on the button 如果用户单击按钮,我的系统将打开安装
intent.setDataAndType(Uri.parse("file://sdcard/abc.apk"), "application/vnd.android.package-archive");
i am looking for the solution which the system will auto delete the apk file once the installation is done. 我正在寻找解决方案,一旦安装完成,系统将自动删除apk文件。
You could listen from the intent broadcast ACTION_PACKAGE_ADDED. 您可以从意图广播ACTION_PACKAGE_ADDED中收听。 Here is a list of all intent broadcasts .
这是所有意图广播的列表 。 Do note that there are different broadcasts if the package is installed, or if it updates another package.
请注意,如果安装了软件包或更新了另一个软件包,则广播会有所不同。 I would guess that there are information in the broadcast as to which package that was installed, so you don't accidentally delete the apk when another app is installed :)
我想广播中有关于已安装哪个软件包的信息,因此在安装另一个应用程序时,您不会意外删除apk :)
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.