android安装app
16lz
2021-12-18
private void install(String filePath) {chmod("777", filePath);Intent intent = new Intent(Intent.ACTION_VIEW);intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);/* * intent.setDataAndType(Uri.parse("file://" + filePath), * "application/vnd.android.package-archive"); */intent.setDataAndType(Uri.fromFile(new File(filePath)),"application/vnd.android.package-archive");startActivity(intent);finish();}两种方法都可以实现
更多相关文章
- Android中重写onBackPressed()方法实现双击退出
- Android(安卓)四大组件--service的使用与生命周期
- android屏幕保持唤醒
- Android(安卓)View的构造方法
- ClassNotFoundException 案例
- Android(安卓)实现监听事件的几种方法
- Android(安卓)中的 requestWindowFeature
- 浅谈Java中Collections.sort对List排序的两种方法
- Python list sort方法的具体使用