Context Menu in Android is a floating menu, which might not be there initially but might appear only after a certain action is done. For example, it might appear after a long press of the home button. This kind of phenomenon is also known as the reference frame act. We can compare the context menu with something like right-click menu on Windows. The context menu scopes the actions which are capable of changing a particular context frame in the UI, and a developer can specify a context menu for any kind of view. The following code shows how a context menu can be created in an activity file.
The code will develop something like this as shown below. If you long press on the text, the menu will appear.
It is used for displaying the action items affecting some selected contents in a bar at the screen's top. It also allows the users to select multiple items.
It is the additional information about the context menu creation.
|