我想从 Android 应用程序中安装 APK。谁能举例说明如何执行此操作?
编辑:
另外,如何打开“从未知资源安装应用程序”首选项页面以便用户可以更改它?
编辑:
我实际上是指使用代码打开屏幕,这样我就可以立即打开首选项页面,用户只需选中该框,然后按返回键即可。是否可以检查他们是否允许非市场应用程序?
应用程序能否请求足够的权限来执行此操作?
最佳答案
使用带有 apk 文件链接的 intent。
Intent intent = new Intent(Intent.ACTION_VIEW ,Uri.parse("http://movil.reforma.com/android/Android_Noticias_Reforma.apk"));
startActivity(intent);
从未知资源偏好安装应用程序
去
Settings > Applications > Unknow sources
关于java - 从 Assets 或 RAW 文件夹安装 APK,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3427774/