Android: How to set a generated contextMenu title?
-
10-10-2019 - |
Question
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?
Solution
menu.setHeaderTitle("This is my title");
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow