コード例 #1
0
 @Override
 public void showServiceAreaList() {
   FragmentManager fragmentManager = getSupportFragmentManager();
   fragmentManager
       .beginTransaction()
       .replace(R.id.container, ServiceAreaFragment.newInstance(), "main")
       .commit();
 }
コード例 #2
0
 @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);
 }