I'm not entirely sure this is possible, but I have several activities that use a listview adapter. I want to implement a context menu on the listview items which I have been able to do using
public View getView(int position, View convertView, ViewGroup parent) {
View vi = convertView;
vi.setOnCreateContextMenuListener(new OnCreateContextMenuListener() {
@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
menu.setHeaderTitle(sf.checkBusinessTitle(businessList.getBusinessName()));
....rest of context menu creation code...
}
}
How can I create the onContextItemSelected from the adapter?
EDIT: I get the error "The method onContextItemSelected(MenuItem) of type MyAdapter must override or implement a supertype method" if I add the following to the adapter:
@Override
public boolean onContextItemSelected(MenuItem item){
}
Any help would be appreciated.