예제 #1
0
  @Override
  public boolean onOptionsItemSelected(MenuItem item) {
    switch (item.getItemId()) {
      case R.id.action_restart:
        mCustomCardsAdapter.clearCards();
        mMainCardsPresenter.setView(this);
        return true;
    }

    return super.onOptionsItemSelected(item);
  }
예제 #2
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
    ButterKnife.bind(this);

    setSupportActionBar(mToolbar);
    initialiseCards();

    mMainCardsPresenter = new MainCardsPresenter();
    mMainCardsPresenter.setView(this);
  }