lv.setOnItemClickListen开发者_高级运维er(new OnItemClickListener() {
@Override
public void onItemClick(AdapterView<?> arg0, View arg1, int arg2,
long arg3) {
AlertDialog.Builder adb=new AlertDialog.Builder(activity2.this);
adb.setTitle("Delete?");
adb.setMessage("Are you sure you want to delete " + arg0);
adb.setNegativeButton("Cancel", null);
adb.setPositiveButton("Ok", new AlertDialog.OnClickListener() {
public void onClick(DialogInterface dialog, int which) {
Toast.makeText(getApplicationContext(), "Delete", Toast.LENGTH_LONG).show();
继续阅读:androidonitemclicklistener
精彩评论