android-components / mozilla.components.feature.contextmenu / ContextMenuFeature

# ContextMenuFeature

`class ContextMenuFeature` (source)

Feature for displaying a context menu after long-pressing web content.

This feature will subscribe to the currently selected Session and display the context menu based on Session.Observer.onLongPress events. Once the context menu is closed or the user selects an item from the context menu the related HitResult will be consumed.

### Constructors

<init> | `ContextMenuFeature(fragmentManager: FragmentManager, sessionManager: SessionManager, candidates: List<ContextMenuCandidate>)` Feature for displaying a context menu after long-pressing web content.

### Functions

start | `fun start(): Unit` Start observing the selected session and when needed show a context menu.
stop | `fun stop(): Unit` Stop observing the selected session and do not show any context menus anymore.