Code example for FragmentActivity

Methods: getSupportFragmentManager, invalidateOptionsMenu, onCreate, setContentView

0
public final class Issue0048 extends FragmentActivity { 
    private Menu mMenu;
     
	@Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
         
        ViewPager pager = new ViewPager(this);
        pager.setId(1);
        setContentView(pager);
         
        pager.setAdapter(new TestAdapter(getSupportFragmentManager()));
        invalidateOptionsMenu(); 
    } 
	 
	@Override 
    public boolean onCreateOptionsMenu(Menu menu) {
	    mMenu = menu;
        return super.onCreateOptionsMenu(menu);
    }