android安装app

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,更新app)