Class ActionMenuActivity

java.lang.Object
android.content.Context
android.content.ContextWrapper
android.view.ContextThemeWrapper
android.app.Activity
androidx.core.app.ComponentActivity
androidx.activity.ComponentActivity
androidx.fragment.app.FragmentActivity
androidx.appcompat.app.AppCompatActivity
com.vuzix.hud.resources.DynamicThemeActivity
com.vuzix.hud.actionmenu.ActionMenuActivity
All Implemented Interfaces:
android.content.ComponentCallbacks, android.content.ComponentCallbacks2, android.view.KeyEvent.Callback, android.view.LayoutInflater.Factory, android.view.LayoutInflater.Factory2, android.view.View.OnCreateContextMenuListener, android.view.Window.Callback, androidx.activity.contextaware.ContextAware, androidx.activity.OnBackPressedDispatcherOwner, androidx.activity.result.ActivityResultCaller, androidx.activity.result.ActivityResultRegistryOwner, androidx.appcompat.app.ActionBarDrawerToggle.DelegateProvider, androidx.appcompat.app.AppCompatCallback, androidx.core.app.ActivityCompat.OnRequestPermissionsResultCallback, androidx.core.app.ActivityCompat.RequestPermissionsRequestCodeValidator, androidx.core.app.TaskStackBuilder.SupportParentable, androidx.core.view.KeyEventDispatcher.Component, androidx.lifecycle.HasDefaultViewModelProviderFactory, androidx.lifecycle.LifecycleOwner, androidx.lifecycle.ViewModelStoreOwner, androidx.savedstate.SavedStateRegistryOwner

public abstract class ActionMenuActivity extends com.vuzix.hud.resources.DynamicThemeActivity
Activity that implements an action menu. The action menu is implemented very similarly to the standard options menu.
  • Nested Class Summary

    Nested classes/interfaces inherited from class androidx.core.app.ComponentActivity

    androidx.core.app.ComponentActivity.ExtraData
  • Field Summary

    Fields inherited from class android.app.Activity

    DEFAULT_KEYS_DIALER, DEFAULT_KEYS_DISABLE, DEFAULT_KEYS_SEARCH_GLOBAL, DEFAULT_KEYS_SEARCH_LOCAL, DEFAULT_KEYS_SHORTCUT, FOCUSED_STATE_SET, RESULT_CANCELED, RESULT_FIRST_USER, RESULT_OK

    Fields inherited from class android.content.Context

    ACCESSIBILITY_SERVICE, ACCOUNT_SERVICE, ACTIVITY_SERVICE, ALARM_SERVICE, APP_OPS_SERVICE, APPWIDGET_SERVICE, AUDIO_SERVICE, BATTERY_SERVICE, BIND_ABOVE_CLIENT, BIND_ADJUST_WITH_ACTIVITY, BIND_ALLOW_OOM_MANAGEMENT, BIND_AUTO_CREATE, BIND_DEBUG_UNBIND, BIND_EXTERNAL_SERVICE, BIND_IMPORTANT, BIND_INCLUDE_CAPABILITIES, BIND_NOT_FOREGROUND, BIND_NOT_PERCEPTIBLE, BIND_WAIVE_PRIORITY, BIOMETRIC_SERVICE, BLUETOOTH_SERVICE, CAMERA_SERVICE, CAPTIONING_SERVICE, CARRIER_CONFIG_SERVICE, CLIPBOARD_SERVICE, COMPANION_DEVICE_SERVICE, CONNECTIVITY_SERVICE, CONSUMER_IR_SERVICE, CONTEXT_IGNORE_SECURITY, CONTEXT_INCLUDE_CODE, CONTEXT_RESTRICTED, CROSS_PROFILE_APPS_SERVICE, DEVICE_POLICY_SERVICE, DISPLAY_SERVICE, DOWNLOAD_SERVICE, DROPBOX_SERVICE, EUICC_SERVICE, FINGERPRINT_SERVICE, HARDWARE_PROPERTIES_SERVICE, INPUT_METHOD_SERVICE, INPUT_SERVICE, IPSEC_SERVICE, JOB_SCHEDULER_SERVICE, KEYGUARD_SERVICE, LAUNCHER_APPS_SERVICE, LAYOUT_INFLATER_SERVICE, LOCATION_SERVICE, MEDIA_PROJECTION_SERVICE, MEDIA_ROUTER_SERVICE, MEDIA_SESSION_SERVICE, MIDI_SERVICE, MODE_APPEND, MODE_ENABLE_WRITE_AHEAD_LOGGING, MODE_MULTI_PROCESS, MODE_NO_LOCALIZED_COLLATORS, MODE_PRIVATE, MODE_WORLD_READABLE, MODE_WORLD_WRITEABLE, NETWORK_STATS_SERVICE, NFC_SERVICE, NOTIFICATION_SERVICE, NSD_SERVICE, POWER_SERVICE, PRINT_SERVICE, RECEIVER_VISIBLE_TO_INSTANT_APPS, RESTRICTIONS_SERVICE, ROLE_SERVICE, SEARCH_SERVICE, SENSOR_SERVICE, SHORTCUT_SERVICE, STORAGE_SERVICE, STORAGE_STATS_SERVICE, SYSTEM_HEALTH_SERVICE, TELECOM_SERVICE, TELEPHONY_SERVICE, TELEPHONY_SUBSCRIPTION_SERVICE, TEXT_CLASSIFICATION_SERVICE, TEXT_SERVICES_MANAGER_SERVICE, TV_INPUT_SERVICE, UI_MODE_SERVICE, USAGE_STATS_SERVICE, USB_SERVICE, USER_SERVICE, VIBRATOR_SERVICE, WALLPAPER_SERVICE, WIFI_AWARE_SERVICE, WIFI_P2P_SERVICE, WIFI_RTT_RANGING_SERVICE, WIFI_SERVICE, WINDOW_SERVICE

    Fields inherited from interface android.content.ComponentCallbacks2

    TRIM_MEMORY_BACKGROUND, TRIM_MEMORY_COMPLETE, TRIM_MEMORY_MODERATE, TRIM_MEMORY_RUNNING_CRITICAL, TRIM_MEMORY_RUNNING_LOW, TRIM_MEMORY_RUNNING_MODERATE, TRIM_MEMORY_UI_HIDDEN
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    protected boolean
    Determines if the action menu is shown always or only after user interaction.
    protected void
    closeActionMenu(boolean animate)
    Programmatically closes the action menu.
    boolean
    dispatchKeyEvent(android.view.KeyEvent event)
     
    boolean
    dispatchTouchEvent(android.view.MotionEvent ev)
     
    protected int
    Determines the gravity of the action menu.
    android.content.Context
     
    protected int
    Retrieve the index in the menu for the currently selected MenuItem.
    protected int
    Determines the default action item that will be selected when the action menu displays.
    protected int
    Allows subclasses to specify the default item in the menu based on id.
    protected int
    getMenuItemIndex(android.view.MenuItem item, boolean visibleOnly)
    Retrieve the index in the menu for a specific MenuItem.
    protected boolean
    Determines if all touch events in the activity will be intercepted by the action menu.
    protected void
    Declare that the action menu has changed, so should be recreated.
    protected void
    onActionItemFocused(android.view.MenuItem item)
    This hook is called whenever the focused item in your action menu changes.
    protected boolean
    onActionItemSelected(android.view.MenuItem item)
    This hook is called whenever an item in your action menu is selected.
    protected void
    Called when the action menu is dismissed via a two-finger tap gesture.
    final boolean
    onActionMenuItemSelected(android.view.MenuItem item)
     
    void
     
    protected void
    onCreate(android.os.Bundle savedInstanceState)
     
    protected boolean
    onCreateActionMenu(android.view.Menu menu)
    Initialize the contents of the Activity's action menu.
    void
     
    boolean
    onKeyUp(int keyCode, android.view.KeyEvent event)
     
    protected void
     
    protected boolean
    onPrepareActionMenu(android.view.Menu menu)
    Prepare the Screen's action menu to be displayed.
    protected void
     
    protected void
    onSaveInstanceState(android.os.Bundle outState)
     
    protected void
    Programmatically opens the action menu.
    protected void
    openActionMenu(boolean animate)
    Programmatically opens the action menu.
    protected void
    setCurrentMenuIndex(int index, boolean animate)
    Programmatically set a specific index to be the currently selected item.
    protected void
    setCurrentMenuItem(android.view.MenuItem item, boolean animate)
    Programmatically set a specific MenuItem to be the currently selected item.
    protected void
    setSpeechEnabled(boolean enable)
    Sets whether action menu items will automatically be registered with the speech recognition service.

    Methods inherited from class com.vuzix.hud.resources.DynamicThemeActivity

    useDynamicTheme

    Methods inherited from class androidx.appcompat.app.AppCompatActivity

    addContentView, attachBaseContext, closeOptionsMenu, dispatchKeyEvent, findViewById, getDelegate, getDrawerToggleDelegate, getMenuInflater, getResources, getSupportActionBar, getSupportParentActivityIntent, invalidateOptionsMenu, onConfigurationChanged, onContentChanged, onCreateSupportNavigateUpTaskStack, onDestroy, onKeyDown, onMenuItemSelected, onMenuOpened, onNightModeChanged, onPanelClosed, onPostCreate, onPostResume, onPrepareSupportNavigateUpTaskStack, onStart, onStop, onSupportActionModeFinished, onSupportActionModeStarted, onSupportContentChanged, onSupportNavigateUp, onTitleChanged, onWindowStartingSupportActionMode, openOptionsMenu, setContentView, setContentView, setContentView, setSupportActionBar, setSupportProgress, setSupportProgressBarIndeterminate, setSupportProgressBarIndeterminateVisibility, setSupportProgressBarVisibility, setTheme, startSupportActionMode, supportInvalidateOptionsMenu, supportNavigateUpTo, supportRequestWindowFeature, supportShouldUpRecreateTask

    Methods inherited from class androidx.fragment.app.FragmentActivity

    dump, getSupportFragmentManager, getSupportLoaderManager, onActivityResult, onAttachFragment, onCreatePanelMenu, onCreateView, onCreateView, onLowMemory, onMultiWindowModeChanged, onNewIntent, onPictureInPictureModeChanged, onPrepareOptionsPanel, onPreparePanel, onRequestPermissionsResult, onResumeFragments, onStateNotSaved, setEnterSharedElementCallback, setExitSharedElementCallback, startActivityFromFragment, startActivityFromFragment, startIntentSenderFromFragment, supportFinishAfterTransition, supportPostponeEnterTransition, supportStartPostponedEnterTransition, validateRequestPermissionsRequestCode

    Methods inherited from class androidx.activity.ComponentActivity

    addOnContextAvailableListener, getActivityResultRegistry, getDefaultViewModelProviderFactory, getLastCustomNonConfigurationInstance, getLifecycle, getOnBackPressedDispatcher, getSavedStateRegistry, getViewModelStore, onBackPressed, onRetainCustomNonConfigurationInstance, onRetainNonConfigurationInstance, peekAvailableContext, registerForActivityResult, registerForActivityResult, removeOnContextAvailableListener, reportFullyDrawn, startActivityForResult, startActivityForResult, startIntentSenderForResult, startIntentSenderForResult

    Methods inherited from class androidx.core.app.ComponentActivity

    dispatchKeyShortcutEvent, getExtraData, putExtraData, superDispatchKeyEvent

    Methods inherited from class android.app.Activity

    closeContextMenu, createPendingResult, dismissDialog, dismissKeyboardShortcutsHelper, dispatchGenericMotionEvent, dispatchPopulateAccessibilityEvent, dispatchTrackballEvent, enterPictureInPictureMode, enterPictureInPictureMode, finish, finishActivity, finishActivityFromChild, finishAffinity, finishAfterTransition, finishAndRemoveTask, finishFromChild, getActionBar, getApplication, getCallingActivity, getCallingPackage, getChangingConfigurations, getComponentName, getContentScene, getContentTransitionManager, getCurrentFocus, getFragmentManager, getIntent, getLastNonConfigurationInstance, getLayoutInflater, getLoaderManager, getLocalClassName, getMaxNumPictureInPictureActions, getMediaController, getParent, getParentActivityIntent, getPreferences, getReferrer, getRequestedOrientation, getSearchEvent, getSystemService, getTaskId, getTitle, getTitleColor, getVoiceInteractor, getVolumeControlStream, getWindow, getWindowManager, hasWindowFocus, isActivityTransitionRunning, isChangingConfigurations, isChild, isDestroyed, isFinishing, isImmersive, isInMultiWindowMode, isInPictureInPictureMode, isLocalVoiceInteractionSupported, isTaskRoot, isVoiceInteraction, isVoiceInteractionRoot, managedQuery, moveTaskToBack, navigateUpTo, navigateUpToFromChild, onActionModeFinished, onActionModeStarted, onActivityReenter, onApplyThemeResource, onAttachFragment, onChildTitleChanged, onContextItemSelected, onContextMenuClosed, onCreate, onCreateContextMenu, onCreateDescription, onCreateDialog, onCreateDialog, onCreateNavigateUpTaskStack, onCreateOptionsMenu, onCreatePanelView, onCreateThumbnail, onEnterAnimationComplete, onGenericMotionEvent, onGetDirectActions, onKeyLongPress, onKeyMultiple, onKeyShortcut, onLocalVoiceInteractionStarted, onLocalVoiceInteractionStopped, onMultiWindowModeChanged, onNavigateUp, onNavigateUpFromChild, onOptionsItemSelected, onOptionsMenuClosed, onPerformDirectAction, onPictureInPictureModeChanged, onPostCreate, onPrepareDialog, onPrepareDialog, onPrepareNavigateUpTaskStack, onPrepareOptionsMenu, onProvideAssistContent, onProvideAssistData, onProvideKeyboardShortcuts, onProvideReferrer, onRestart, onRestoreInstanceState, onRestoreInstanceState, onSaveInstanceState, onSearchRequested, onSearchRequested, onTopResumedActivityChanged, onTouchEvent, onTrackballEvent, onTrimMemory, onUserInteraction, onUserLeaveHint, onVisibleBehindCanceled, onWindowAttributesChanged, onWindowFocusChanged, onWindowStartingActionMode, onWindowStartingActionMode, openContextMenu, overridePendingTransition, postponeEnterTransition, recreate, registerActivityLifecycleCallbacks, registerForContextMenu, releaseInstance, removeDialog, requestDragAndDropPermissions, requestPermissions, requestShowKeyboardShortcuts, requestVisibleBehind, requestWindowFeature, requireViewById, runOnUiThread, setActionBar, setContentTransitionManager, setDefaultKeyMode, setEnterSharedElementCallback, setExitSharedElementCallback, setFeatureDrawable, setFeatureDrawableAlpha, setFeatureDrawableResource, setFeatureDrawableUri, setFinishOnTouchOutside, setImmersive, setInheritShowWhenLocked, setIntent, setMediaController, setPictureInPictureParams, setProgress, setProgressBarIndeterminate, setProgressBarIndeterminateVisibility, setProgressBarVisibility, setRequestedOrientation, setResult, setResult, setSecondaryProgress, setShowWhenLocked, setTaskDescription, setTitle, setTitle, setTitleColor, setTurnScreenOn, setVisible, setVolumeControlStream, setVrModeEnabled, shouldShowRequestPermissionRationale, shouldUpRecreateTask, showAssist, showDialog, showDialog, showLockTaskEscapeMessage, startActionMode, startActionMode, startActivities, startActivities, startActivity, startActivity, startActivityFromChild, startActivityFromChild, startActivityFromFragment, startActivityFromFragment, startActivityIfNeeded, startActivityIfNeeded, startIntentSender, startIntentSender, startIntentSenderFromChild, startIntentSenderFromChild, startLocalVoiceInteraction, startLockTask, startManagingCursor, startNextMatchingActivity, startNextMatchingActivity, startPostponedEnterTransition, startSearch, stopLocalVoiceInteraction, stopLockTask, stopManagingCursor, takeKeyEvents, triggerSearch, unregisterActivityLifecycleCallbacks, unregisterForContextMenu

    Methods inherited from class android.view.ContextThemeWrapper

    applyOverrideConfiguration, getAssets, getTheme, setTheme

    Methods inherited from class android.content.ContextWrapper

    bindIsolatedService, bindService, bindService, checkCallingOrSelfPermission, checkCallingOrSelfUriPermission, checkCallingPermission, checkCallingUriPermission, checkPermission, checkSelfPermission, checkUriPermission, checkUriPermission, clearWallpaper, createConfigurationContext, createContextForSplit, createDeviceProtectedStorageContext, createDisplayContext, createPackageContext, databaseList, deleteDatabase, deleteFile, deleteSharedPreferences, enforceCallingOrSelfPermission, enforceCallingOrSelfUriPermission, enforceCallingPermission, enforceCallingUriPermission, enforcePermission, enforceUriPermission, enforceUriPermission, fileList, getApplicationContext, getApplicationInfo, getBaseContext, getCacheDir, getClassLoader, getCodeCacheDir, getContentResolver, getDatabasePath, getDataDir, getDir, getExternalCacheDir, getExternalCacheDirs, getExternalFilesDir, getExternalFilesDirs, getExternalMediaDirs, getFilesDir, getFileStreamPath, getMainExecutor, getMainLooper, getNoBackupFilesDir, getObbDir, getObbDirs, getOpPackageName, getPackageCodePath, getPackageManager, getPackageName, getPackageResourcePath, getSharedPreferences, getSystemServiceName, getWallpaper, getWallpaperDesiredMinimumHeight, getWallpaperDesiredMinimumWidth, grantUriPermission, isDeviceProtectedStorage, isRestricted, moveDatabaseFrom, moveSharedPreferencesFrom, openFileInput, openFileOutput, openOrCreateDatabase, openOrCreateDatabase, peekWallpaper, registerReceiver, registerReceiver, registerReceiver, registerReceiver, removeStickyBroadcast, removeStickyBroadcastAsUser, revokeUriPermission, revokeUriPermission, sendBroadcast, sendBroadcast, sendBroadcastAsUser, sendBroadcastAsUser, sendOrderedBroadcast, sendOrderedBroadcast, sendOrderedBroadcastAsUser, sendStickyBroadcast, sendStickyBroadcastAsUser, sendStickyOrderedBroadcast, sendStickyOrderedBroadcastAsUser, setWallpaper, setWallpaper, startForegroundService, startInstrumentation, startService, stopService, unbindService, unregisterReceiver, updateServiceGroup

    Methods inherited from class android.content.Context

    getColor, getColorStateList, getDrawable, getString, getString, getSystemService, getText, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, obtainStyledAttributes, registerComponentCallbacks, unregisterComponentCallbacks

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface android.view.Window.Callback

    onPointerCaptureChanged
  • Constructor Details

    • ActionMenuActivity

      public ActionMenuActivity()
  • Method Details

    • onCreate

      protected void onCreate(android.os.Bundle savedInstanceState)
      Overrides:
      onCreate in class com.vuzix.hud.resources.DynamicThemeActivity
    • getContext

      public android.content.Context getContext()
    • onAttachedToWindow

      public void onAttachedToWindow()
      Specified by:
      onAttachedToWindow in interface android.view.Window.Callback
      Overrides:
      onAttachedToWindow in class android.app.Activity
    • onDetachedFromWindow

      public void onDetachedFromWindow()
      Specified by:
      onDetachedFromWindow in interface android.view.Window.Callback
      Overrides:
      onDetachedFromWindow in class android.app.Activity
    • onSaveInstanceState

      protected void onSaveInstanceState(@NonNull android.os.Bundle outState)
      Overrides:
      onSaveInstanceState in class androidx.activity.ComponentActivity
    • onResume

      protected void onResume()
      Overrides:
      onResume in class androidx.fragment.app.FragmentActivity
    • onPause

      protected void onPause()
      Overrides:
      onPause in class androidx.fragment.app.FragmentActivity
    • onActionMenuItemSelected

      public final boolean onActionMenuItemSelected(android.view.MenuItem item)
    • setSpeechEnabled

      protected void setSpeechEnabled(boolean enable)
      Sets whether action menu items will automatically be registered with the speech recognition service. By default this is true and subclasses can choose to opt-out by calling setSpeechEnabled(false) during onCreate().
      Parameters:
      enable - true to enable automatic speech recognition registration, false otherwise
    • alwaysShowActionMenu

      protected boolean alwaysShowActionMenu()
      Determines if the action menu is shown always or only after user interaction. Subclasses may override to change behavior
      Returns:
      true to always show action menu, false to only show after user interaction
    • invalidateActionMenu

      protected void invalidateActionMenu()
      Declare that the action menu has changed, so should be recreated. The onCreateActionMenu(Menu) method will be called the next time it needs to be displayed. If the action menu is currently being displayed, the menu will be rebuilt immediately.
    • onCreateActionMenu

      protected boolean onCreateActionMenu(android.view.Menu menu)
      Initialize the contents of the Activity's action menu. You should place your menu items in to menu.

      This is only called once, the first time the action menu is displayed. To update the menu every time it is displayed, see onPrepareActionMenu(android.view.Menu).

      The default implementation populates the menu with a back menu item. Deriving classes should always call through to the base implementation.

      You can safely hold on to menu (and any items created from it), making modifications to it as desired, until the next time onCreateOptionsMenu() is called.

      When you add items to the menu, you can implement the Activity's onActionItemSelected(android.view.MenuItem) method to handle them there.

      Parameters:
      menu - The action menu in which you place your items.
      Returns:
      You must return true for the menu to be displayed; if you return false it will not be shown.
      See Also:
    • getDefaultAction

      protected int getDefaultAction()
      Determines the default action item that will be selected when the action menu displays. By default it is the first item in the menu. Override this method to change the behavior.
      Returns:
      the index of the default menu item to select
    • getDefaultActionId

      protected int getDefaultActionId()
      Allows subclasses to specify the default item in the menu based on id. This will be called before getDefaultAction. If this method returns a non-zero value, that will be used as the default ID, otherwise, getDefaultAction will be called as a fallback.
      Returns:
      the id the default menu item to select
    • onPrepareActionMenu

      protected boolean onPrepareActionMenu(android.view.Menu menu)
      Prepare the Screen's action menu to be displayed. This is called right before the menu is shown, every time it is shown. You can use this method to efficiently enable/disable items or otherwise dynamically modify the contents.
      Parameters:
      menu - The options menu as last shown or first initialized by onCreateActionMenu().
      Returns:
      You must return true for the menu to be displayed; if you return false it will not be shown.
      See Also:
    • onActionItemFocused

      protected void onActionItemFocused(android.view.MenuItem item)
      This hook is called whenever the focused item in your action menu changes. The default implementation does nothing. Subclasses can override to perform logic as the focus changes.
      Parameters:
      item - The menu item that has focus.
    • onActionItemSelected

      protected boolean onActionItemSelected(android.view.MenuItem item)
      This hook is called whenever an item in your action menu is selected. The default implementation simply returns false to have the normal processing happen. You can use this method for any items for which you would like to do processing without those other facilities.

      Derived classes should call through to the base class for it to perform the default menu handling.

      You will need to call this super method in a derived class before checking the state of a checkable ActionMenuItem within this function. This ensures the ActionMenuItem properly animates.

      Parameters:
      item - The menu item that was selected.
      Returns:
      boolean Return false to allow normal menu processing to proceed, true to consume it here.
      See Also:
    • onActionMenuClosed

      protected void onActionMenuClosed()
      Called when the action menu is dismissed via a two-finger tap gesture. This method is called after the action menu pop-up is dismissed. Developers may override this function to receive this callback within their application.
    • setCurrentMenuItem

      protected void setCurrentMenuItem(android.view.MenuItem item, boolean animate)
      Programmatically set a specific MenuItem to be the currently selected item. If the specified item is not found or is not currently visible, nothing will change.
      Parameters:
      item - The MenuItem to select
      animate - whether or not to animate the selection change
    • setCurrentMenuIndex

      protected void setCurrentMenuIndex(int index, boolean animate)
      Programmatically set a specific index to be the currently selected item. If the specified index is not valid or the menu is not currently visible, nothing will change.
      Parameters:
      index - The index of a MenuItem to select
      animate - whether or not to animate the selection change
    • getCurrentMenuIndex

      protected int getCurrentMenuIndex()
      Retrieve the index in the menu for the currently selected MenuItem.
      Returns:
      The index of the currently viewed MenuItem. If the menu is not currently shown, -1 will be returned.
    • getMenuItemIndex

      protected int getMenuItemIndex(android.view.MenuItem item, boolean visibleOnly)
      Retrieve the index in the menu for a specific MenuItem.
      Parameters:
      item - The MenuItem to look for
      visibleOnly - if true, only the currently visible menu items will be searched
      Returns:
      The index of the specified MenuItem. If the item was not found, or visibleOnly was true, and the desired MenuItem is not currently visible, -1 will be returned.
    • openActionMenu

      protected void openActionMenu()
      Programmatically opens the action menu. If the action menu is already open, this method does nothing.
    • openActionMenu

      protected void openActionMenu(boolean animate)
      Programmatically opens the action menu. If the action menu is already open, this method does nothing.
      Parameters:
      animate - true to animate the menu, false to show it without animation
    • getActionMenuGravity

      protected int getActionMenuGravity()
      Determines the gravity of the action menu. By default, the action menu appears at the bottom of the screen. Override this method to change behavior.
      Returns:
      a Gravity constant
    • closeActionMenu

      protected void closeActionMenu(boolean animate)
      Programmatically closes the action menu. If the action menu is already closed, this method does nothing. If the action menu has been specified to always be shown, this method does nothing.
      Parameters:
      animate - true to animate the menu, false to show it without animation
    • onKeyUp

      public boolean onKeyUp(int keyCode, android.view.KeyEvent event)
      Specified by:
      onKeyUp in interface android.view.KeyEvent.Callback
      Overrides:
      onKeyUp in class android.app.Activity
    • dispatchTouchEvent

      public boolean dispatchTouchEvent(android.view.MotionEvent ev)
      Specified by:
      dispatchTouchEvent in interface android.view.Window.Callback
      Overrides:
      dispatchTouchEvent in class android.app.Activity
    • interceptAllTouches

      protected boolean interceptAllTouches()
      Determines if all touch events in the activity will be intercepted by the action menu.
      Returns:
      true to intercept all touch events, false to allow then to process normally
    • dispatchKeyEvent

      boolean dispatchKeyEvent(android.view.KeyEvent event)