当前位置: 代码迷 >> Android >> android 装配app私有存储目录下的apk
  详细解决方案

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

热度:41   发布时间:2016-05-01 10:53:16.0
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();		}
  相关解决方案