Added in API level 1

View.OnCreateContextMenuListener


public static interface View.OnCreateContextMenuListener

android.view.View.OnCreateContextMenuListener
AccountAuthenticatorActivity This class was deprecated in API level 30. Applications should extend Activity themselves. This class is not compatible with AppCompat, and the functionality it provides is not complex. 
Activity An activity is a single, focused thing that the user can do. 
ActivityGroup This class was deprecated in API level 13. Use the new Fragment and FragmentManager APIs instead; these are also available on older platforms through the Android compatibility package. 
AlertDialog A subclass of Dialog that can display one, two or three buttons. 
AliasActivity This class was deprecated in API level 30. Use <activity-alias> or subclass Activity directly. 
CharacterPickerDialog Dialog for choosing accented characters related to a base character. 
DatePickerDialog A simple dialog containing an DatePicker
Dialog Base class for Dialogs. 
DialogFragment This class was deprecated in API level 28. Use the Support Library DialogFragment for consistent behavior across all devices and access to Lifecycle. 
ExpandableListActivity This class was deprecated in API level 30. Use RecyclerView or use ExpandableListView directly 
Fragment This class was deprecated in API level 28. Use the Jetpack Fragment Library Fragment for consistent behavior across all devices and access to Lifecycle. 
LauncherActivity This class was deprecated in API level 30. Applications can implement this UI themselves using RecyclerView and PackageManager.queryIntentActivities(Intent, int) 
ListActivity This class was deprecated in API level 30. Use ListFragment or RecyclerView to implement your Activity instead. 
ListFragment This class was deprecated in API level 28. Use the Support Library ListFragment for consistent behavior across all devices and access to Lifecycle. 
NativeActivity Convenience for implementing an activity that will be implemented purely in native code. 
PreferenceActivity This class was deprecated in API level 29. Use the AndroidX Preference Library for consistent behavior across all devices. For more information on using the AndroidX Preference Library see Settings. 
PreferenceFragment This class was deprecated in API level 28. Use the AndroidX Preference Library for consistent behavior across all devices. For more information on using the AndroidX Preference Library see Settings. 
Presentation Base class for presentations. 
ProgressDialog This class was deprecated in API level 26. ProgressDialog is a modal dialog, which prevents the user from interacting with the app. Instead of using this class, you should use a progress indicator like ProgressBar, which can be embedded in your app's UI. Alternatively, you can use a notification to inform the user of the task's progress. 
TabActivity This class was deprecated in API level 13. New applications should use Fragments instead of this class; to continue to run on older devices, you can use the v4 support library which provides a version of the Fragment API that is compatible down to Build.VERSION_CODES.DONUT. 
TimePickerDialog A dialog that prompts the user for the time of day using a TimePicker
WebViewFragment This class was deprecated in API level 28. Manually call WebView.onPause() and WebView.onResume() 


Interface definition for a callback to be invoked when the context menu for this view is being built.

Summary

Public methods

abstract void onCreateContextMenu(ContextMenu menu, View v, ContextMenu.ContextMenuInfo menuInfo)

Called when the context menu for this view is being built.

Public methods

onCreateContextMenu

Added in API level 1
public abstract void onCreateContextMenu (ContextMenu menu, 
                View v, 
                ContextMenu.ContextMenuInfo menuInfo)

Called when the context menu for this view is being built. It is not safe to hold onto the menu after this method returns.

Parameters
menu ContextMenu: The context menu that is being built

v View: The view for which the context menu is being built

menuInfo ContextMenu.ContextMenuInfo: Extra information about the item for which the context menu should be shown. This information will vary depending on the class of v.