<span style="font-size:18px;"><span style="white-space:pre"> </span>Intent intent2 = new Intent();
intent2.setAction("android.intent.action.VIEW");
intent2.setAction("android.intent.action.DELETE");
intent2.addCategory("android.intent.category.DEFAULT");</span>
<span style="font-size:18px;"><span style="white-space:pre"> </span>//</span><span style="font-size: 18px; font-family: Arial, Helvetica, sans-serif;">appinfo.getPackageName()是得到要卸载的程序的包名</span><span style="font-size:18px;">
<span style="white-space:pre"> </span>intent2.setData(Uri.parse("package:" + appinfo.getPackageName()));
startActivityForResult(intent2, 0);</span>
</pre><p><span style="font-family:monospace;font-size:18px;"><span style="white-space: pre;"><span style="white-space:pre"> </span></span></span></p><p><span style="font-family:monospace;font-size:18px;"></span></p><p><span style="font-family:monospace;font-size:18px;white-space: pre;">程序卸载后如果要做相应的处理,就在启动Activity的回调函数里操作</span></p><p><span style="font-family:monospace;font-size:18px;white-space: pre;"></span></p><p><span style="font-family:monospace;font-size:18px;white-space: pre;"></span><pre name="code" class="java">@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
// TODO Auto-generated method stub
super.onActivityResult(requestCode, resultCode, data);
Log.i("huang", "resultCode:"+requestCode);
if(isClickUserApp){
userApps.remove(newposition);
}
else{
systemApps.remove(newposition);
}
<span style="white-space:pre"> </span>//刷新listView
myAdapter.notifyDataSetChanged();
}