@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); mExplosionField = ExplosionField.attach2Window(this); addListener(findViewById(R.id.root)); }
@Override public boolean onOptionsItemSelected(MenuItem item) { if (item.getItemId() == R.id.action_reset) { View root = findViewById(R.id.root); reset(root); addListener(root); mExplosionField.clear(); return true; } return super.onOptionsItemSelected(item); }