Colleagues, MainActivity
class is derived from FragmentActivity
, and for some reason activity's onCreateOptionsMenu()
is not getting called. I have the first breakpoint in onCreate()
, which is getting triggered, and the second one in onCreateOptionsMenu()
, which is not getting triggered.
import android.support.v4.app.FragmentActivity;
public class MainActivity extends FragmentActivity {
private FragmentPagerAdapter m_fragmentPagerAdapter;
private ViewPager m_viewPager;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// Create the adapter that will return a fragment for each of the primary sections of the activity.
m_fragmentPagerAdapter = new SectionsPagerAdapter(getSupportFragmentManager());
// Set up the ViewPager with the sections adapter.
m_viewPager = (ViewPager) findViewById(R.id.container);
m_viewPager.setAdapter(m_fragmentPagerAdapter);
}
@Override
public boolean onCreateOptionsMenu(Menu menu) {
getMenuInflater().inflate(R.menu.menu_main, menu); // Inflate the menu; this adds items to the action bar if it is present.
return true;
}
}
Fragments in this app don't have their own menus. One menu belonging to the activity "covers" everything.
Theme is Holo.Light
What prevent onCreateOptionsMenu()
from getting called? What am I missing?