Q:

Contextual Menu in a Fragment inside a Fragment (ActionMode)

I got a Fragment B in a Fragment A in a Activity. Works as expected.
When clicking an item in Fragment B, I want to display a contextual menu bar.
I am working with ActionbarSherlock.
What i've done this inside my Fragment B:
private ActionMode.Callback mActionModeCallback = new ActionMode.Callback() {

    @Override
    public boolean onCreateActionMode(ActionMode mode, Menu menu) {
        MenuInflater inflater = mode.getMenuInflater();
        inflater.inflate(R.menu.entry_list_context_menu, menu);
        return true;
    }

    @Override
    public boolean onPrepareActionMode(ActionMode mode, Menu menu) {
        // make sure no item is selected when bar is shown
        adapter.clearSelection();
        adapter.notifyDataSetChanged();
        return false;
    }

    @Override
    public boolean onActionItemClicked(ActionMode mode, MenuItem item) {
        Log.d("EntryList", "Item '" + item.getTitle()
                + "' clicked [onActionItemClicked()]");
        return true;
    }

    @Override
    public void onDestroyActionMode(ActionMode mode) {
        adapter.clearSelection();
        adapter.notifyDataSetChanged();
        contextualMode = null;
    }
};
private ActionMode contextualMode;

@Override
public void onItemClick(AdapterView<?> parentView, View itemView,
        int index, long id) {
    DocumentEntity entry = (DocumentEntity) itemView.getTag();
    // something went wrong
    if (entry == null) {
        Log.e("EntryList", "Tag-Less item clicked [onItemClick()]");
        return;
    }

    if (contextualMode != null) {
        Log.d("EntryList",
                "contextualMode is not yet initialized [onItemClick()]");
        contextualMode = getSherlockActivity().startActionMode(
                mActionModeCallback);
    } else {
        Log.d("EntryList",
                "contextualMode already initialized [onItemClick()]");
    }

    entry.setSelected(!entry.isSelected());
    Log.d("EntryList", "entry.selected set to " + entry.isSelected()
            + " [onItemClick()]");
}

The selection works pretty good, but no contextual Actionbar is shown. 
The debug result is:

contextualMode already initialized [onItemClick()] entry.selected set
  to 'true' [onItemClick()]

There is no other position where contextualMode is set...

A:

I got a Fragment B in a Fragment A...

Android does not support embedding a fragment within another fragment. Sorry. This leads me to believe that your problem goes beyond the fact that your contextual ActionBar is not being shown. I suggest you clarify your original post.

