首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 移动开发 > Android >

android 装配app私有存储目录下的apk

2013-04-09 
android 安装app私有存储目录下的apk一般安装app就是Intent i new Intent(Intent.ACTION_VIEW)// i.add

android 安装app私有存储目录下的apk
一般安装app就是

Intent i = new Intent(Intent.ACTION_VIEW);// i.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);i.setDataAndType(Uri.parse("file://" + mFilePath),"application/vnd.android.package-archive");mContext.startActivity(i);

但在“/data/data/packageName”下的有权限限制,加入下面的代码应该可以了
String cmd = "chmod 777 " + mFilePath;try {Runtime.getRuntime().exec(cmd);} catch (Exception e) {e.printStackTrace();}

热点排行