/** * 根据包名 卸载应用 */ private void removeApp(String packageName) { Intent intent = new Intent(); intent.setAction(Intent.ACTION_VIEW); intent.setAction(Intent.ACTION_DELETE); intent.addCategory(Intent.CATEGORY_DEFAULT); intent.setData( Uri.parse( new StringBuilder("package:") .append(packageName).toString())); startActivityForResult(intent, 0); } @Override protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // 卸载成功后做 处理 buildDatas(); }