@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); }
@Override public boolean onNavigationItemSelected(MenuItem menuItem) { return presenter.onNavigationItemSelected(menuItem.getItemId()); }
@Override public boolean onOptionsItemSelected(MenuItem item) { return presenter.onOptionsItemSelected(item.getItemId()) || super.onOptionsItemSelected(item); }
protected void onDestroy() { presenter.onDestroy(); super.onDestroy(); }