Các bạn trong diễn đàn cho mình hỏi cách xoá 1 item trong listview dung contextmenu. Code của mình đây. Cám ơn.

import android.os.Bundle;
import android.app.Activity;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ArrayAdapter;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;


public class MainActivity extends Activity {


EditText ed;
Button btn;
ListView lv;
ArrayAdapter<String> Arr;
protected static final int CONTEXTMENU_DELETEITEM = 0;

@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);

ed = (EditText)findViewById(R.id.editText1);
btn = (Button)findViewById(R.id.button1);
lv = (ListView)findViewById(R.id.listView1);
Arr = new ArrayAdapter<String>(this, android.R.layout.simple_list_item_1);
lv.setAdapter(Arr);

btn.setOnClickListener(new OnClickListener() {

@Override
public void onClick(View v) {
// TODO Auto-generated method stub
String s = ed.getText().toString();
Arr.add(s);
registerForContextMenu(lv);
ed.setText("");
lv.setOnItemClickListener(new OnItemClickListener() {


@Override
public void onItemClick(AdapterView<?> av, View v,
int position, long id) {
// TODO Auto-generated method stub
av.showContextMenu();
}
});
}
});
}

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) menuInfo;
menu.setHeaderTitle("Menu");
menu.add(Menu.NONE, 0, 0, "Delete");
}


public boolean onContextItemSelected(MenuItem item) {
AdapterView.AdapterContextMenuInfo info = (AdapterView.AdapterContextMenuInfo) item.getMenuInfo();
int menuItemIndex = item.getItemId();
//Xoa o day thi phai
return true;
}

@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.activity_main, menu);
return true;
}
}