软件的安装与卸载源码

Focus on technology, enjoy life!—— 杨焕州 QQ:804212028 原文链接: 本文可能存在参考或借助部分外界资源,如有任何侵权行为,请与我联系!

主题:软件的安装与卸载源码

从SDcard安装软件:

String fileName = Environment.getExternalStorageDirectory()+ “/myApp.apk”;Intent intent = new Intent(Intent.ACTION_VIEW);intent.setDataAndType(Uri.parse(“file://” + filePath),”application/vnd.android.package-archive”);

或者用

/**intent.setDataAndType(Uri.fromFile(new File(fileName)),,”application/vnd.android.package-archive”);*/startActivity(intent);

卸载软件

Uri packageURI = Uri.parse(“package:com.android.myapp”);Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);startActivity(uninstallIntent);

Focus on technology, enjoy life!—— 杨焕州 QQ:804212028 原文链接:

未经一番寒彻骨,焉得梅花扑鼻香

软件的安装与卸载源码

相关文章:

你感兴趣的文章:

标签云: