Code example for FragmentActivity

Methods: getSupportFragmentManager, onCreate

0
import android.support.v4.app.FragmentActivity; 
 
public class ViewPagerIndicatorActivity extends FragmentActivity { 
  @Override 
  public void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
 
    if (getSupportFragmentManager().findFragmentById(android.R.id.content) == null) { 
      getSupportFragmentManager().beginTransaction() 
                                 .add(android.R.id.content, 
                                      new PagerFragment()).commit(); 
    } 
  } 
}