1

I have a SherlockFragment that works properly when inflated in a SherlockActivity. I set setHasOptionsMenu(true) on onCreate() and onCreateOptionsMenu() function in that fragment is properly called.

The problem is when I call the fragment under a FragmentPagerAdapter with getItem(), onCreateOptionsMenu() function is not called.

Please help. Thanks!

silvia_aut
  • 1,481
  • 6
  • 19
  • 33
noahutz
  • 1,207
  • 1
  • 9
  • 11

1 Answers1

1

Add this:

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setHasOptionsMenu(true);
}
Haris
  • 4,130
  • 3
  • 30
  • 47