使用长按卸载此列表视图中显示的应用程序时,我的列表视图中出现错误。代码是这样的:
protected boolean setOnItemLongClickListener(ListView l, View v, int position, long id) {
super.onItemLongClick(l, v, position, id);// Error
ApplicationInfo app = applist.get(position);
Uri packageUri = Uri.parse("package:"+app.packageName);
Intent uninstallIntent =
new Intent(Intent.ACTION_DELETE, packageUri);
startActivity(uninstallIntent);
return true;
}
错误是:我该The method onItemLongClick(ListView, View, int, long) is undefined for the type ListActivity
如何解决?我已经实现了OnLongClickListener
. 谢谢