如何使start可以通过外部的按钮调用
我想通过按钮来触发再来一局,但是没有用,
start函数代码一样的,求大神指点
public void start() { mWhiteArray.clear(); mBlackArray.clear(); isGameOver = false; mWhiteWinner = false; invalidate(); System.exit(0); }
public class Exit extends AppCompatActivity { private Yard yard; @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.top_window_exit); Button againButton2 = (Button) findViewById(R.id.againButton2); againButton2.setOnClickListener(mAgainOnClickListener2); yard = (Yard) findViewById(R.id.wuziqi); } private View.OnClickListener mAgainOnClickListener2 = new View.OnClickListener() { @Override public void onClick(View v) { yard.start(); } }; }