Example usage for android.app Fragment onContextItemSelected

List of usage examples for android.app Fragment onContextItemSelected

Introduction

In this page you can find the example usage for android.app Fragment onContextItemSelected.

Prototype

public boolean onContextItemSelected(MenuItem item) 

Source Link

Document

This hook is called whenever an item in a context menu is selected.

Usage

From source file:pl.allegro.fogger.ui.context.ActivityWithContextMenu.java

private boolean invokeOnContextItemSelected(MenuItem menuItem, Object fragment) {
    if (fragment instanceof android.app.Fragment) {
        android.app.Fragment androidFragment = (android.app.Fragment) fragment;
        return androidFragment.onContextItemSelected(menuItem);
    } else if (fragment instanceof android.support.v4.app.Fragment) {
        android.support.v4.app.Fragment supportFragment = (android.support.v4.app.Fragment) fragment;
        return supportFragment.onContextItemSelected(menuItem);
    }// w w  w .j a va  2  s.  c om
    return false;
}