@Override public void showServiceAreaList() { FragmentManager fragmentManager = getSupportFragmentManager(); fragmentManager .beginTransaction() .replace(R.id.container, ServiceAreaFragment.newInstance(), "main") .commit(); }
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); ButterKnife.inject(this); if (savedInstanceState == null) { if (getSupportFragmentManager().findFragmentById(R.id.container) == null) { getSupportFragmentManager() .beginTransaction() .replace(R.id.container, ServiceAreaFragment.newInstance(), "main") .commit(); } } presenter = new MainPresenter(); presenter.onCreate(this); }