Code example for FragmentActivity

Methods: getSupportFragmentManager, onCreate

0
	 
	public boolean triggered = false;
	 
    @Override 
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
         
        getSupportFragmentManager().beginTransaction() 
        	.add(android.R.id.content, new TestFragment())
        	.commit(); 
    } 
     
    public final class TestFragment extends Fragment {
		@Override 
		public void onCreate(Bundle savedInstanceState) {
			super.onCreate(savedInstanceState);
    		setHasOptionsMenu(true);
		} 
 
		@Override 
		public void onCreateOptionsMenu(Menu menu, MenuInflater inflater) {