Code example for FragmentActivity

0
import android.view.MenuInflater; 
import android.view.View; 
import android.view.ViewGroup; 
import android.widget.TextView; 
 
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