Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Android: How to set a generated contextMenu title?

I create a context menu like this:

@Override
public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) {
  if(v.getId() == R.id.ListView01) {
      getMenuInflater().inflate(R.menu.add_contextmenu, menu);
  }
  super.onCreateContextMenu(menu, v, menuInfo);
}

How can I now set a generated title?

like image 644
Tobias Avatar asked Jan 13 '11 02:01

Tobias


1 Answers

menu.setHeaderTitle("This is my title");

See ContextMenu.setHeaderTitle

like image 145
Ian G. Clifton Avatar answered Oct 27 '22 17:10

Ian G. Clifton