Code example for FragmentActivity

0
import android.view.MenuInflater; 
import android.view.View; 
import android.view.ViewGroup; 
import android.widget.FrameLayout; 
 
public final class Issue0002 extends FragmentActivity { 
	public static final String MENU_ITEM_TEXT = "Click";
	 
	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