卸载应用程序关键代码
Intent intent = new Intent();
intent.setAction("android.intent.action.DELETE");filter.addDataScheme("package");
intent.addCategory("android.intent.category.DEFAULT");
intent.setData(Uri.parse("package:" + appInfo.getPackageName()));//这里是包名
startActivity(intent);
分享关键代码
Intent intent = new Intent();
intent.setAction("android.intent.action.SEND");
intent.addCategory("android.intent.category.DEFAULT");
intent.setType("text/plain");
intent.putExtra(Intent.EXTRA_TEXT, "我被分享了");
startActivity(intent);
启动应用程序
PackageManager pm = getPackageManager();
Intent intent = pm.getLaunchIntentForPackage(应用程序包名);
if (intent != null) {
startActivity(intent);
} else {
Toast.makeText(this, "对不起该应用无法被开启", 0).show();
}