android安装app
16lz
2021-01-23
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 实现监听事件的几种方法
- Android View的构造方法
- Android中重写onBackPressed()方法实现双击退出
- Android简单实现更换桌面背景的方法
- android 三种解析,构建xml方法
- Android 文件管理方法
- android中自定义Toast方法详解(一)
- Android在网络中与JavaWeb的项目进行交互的方法