ITeye博客

代码安装android应用

wonka438 · 2012-02-09 15:48 · 移动开发 · Markdown

String str = "/niao.apk";
String fileName = Environment.getExternalStorageDirectory() + str;
Intent intent = new Intent(Intent.ACTION_VIEW);
 intent.setDataAndType(Uri.fromFile(new File(fileName)), "application/vnd.android.package-archive");
startActivity(intent);

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。