Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set a title for a context menu?

Tags:

android

When I bring up the context menu on a contact in the Android built-in app, the context menu has a title (the contact's name). Same for playlist context menu in the Music app.

I have added a context menu to an ImageView (no list item). There is no title, just the options are shown. Is there an easy way to set a title so that my context menu looks like the built-in apps' ones?

like image 845
Miriam Avatar asked Jan 25 '11 15:01

Miriam


People also ask

How do I change the context menu name in Servicenow?

Right-click the list header and configure list control. You should be able to change both of these options. Use the 'Label' field to change the list label and the 'Omit new', 'New roles', or 'Omit new condition' fields to remove the 'New' button.

How do you call a context menu?

A. Pressing Shift-F10 will bring up the context menu for any selected item.

What is the other name of context menu?

A context menu (also know as a contextual menu, shortcut menu or pop-up menu) is the menu that appears when you right-click and offers a set of choices that are available for, or in context of, whatever it was you clicked. The available choices are usually actions specifically related to the selected object.

How do I display context menu?

The context menu (right-hand mouse button or SHIFT+F10 ) allows you to display a context-sensitive menu. The context is defined by the position of the mouse pointer when the user requests the menu. A context menu allows the user to choose functions that are relevant to the current context.


1 Answers

You want to use setHeaderTitle(CharSequence title).

like image 175
McStretch Avatar answered Oct 05 '22 01:10

McStretch