Uri packageURI = Uri.parse("package:com.android.myapp");
Intent uninstallIntent = new Intent(Intent.ACTION_DELETE, packageURI);
startActivity(uninstallIntent);
或者写成
Intent intent = new Intent();
intent.setAction(Intent.ACTION_DELETE);
intent.setData(Uri.parse("package:com.njupt.htmlui1"));
startActivity(intent);
通过代码方式来分享应用程序
// intent.setType("text/plain"); //纯文本
Intent intent=new Intent(Intent.ACTION_SEND);
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_SUBJECT, "Share");
intent.putExtra(Intent.EXTRA_TEXT, "I have successfully share my message through my app");
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
startActivity(Intent.createChooser(intent, getTitle()));/*
* 图片分享 it.setType("image/png"); //添加图片 File f = new
* File(Environment.getExternalStorageDirectory()+"/name.png");
*
* Uri uri = Uri.fromFile(f); intent.putExtra(Intent.EXTRA_STREAM,
* uri);
*/