Focus on technology, enjoy life!—— 杨焕州 QQ:804212028
原文链接:http://blog.csdn.net/y18334702058/article/details/44624305
本文可能存在参考或借助部分外界资源,如有任何侵权行为,请与我联系!
从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
原文链接:http://blog.csdn.net/y18334702058/article/details/44624305
步步为营_Android开发课_番外篇[5]_软件的安装与卸载源码
原文:http://blog.csdn.net/y18334702058/article/details/44780859