I\'m new with android and java, so sorry if it\'s a too basic question but I\'ve tried to find a solution in the forums and google and I couldn\'t.
I have 24 buttons
You can check id of each button such way:
public void onClick(View v) { switch (v.getId()) { case R.id.add_04: Toast.makeText(MainActivity.this, "1", Toast.LENGTH_LONG).show(); break; case R.id.add_05: Toast.makeText(MainActivity.this, "2", Toast.LENGTH_LONG).show(); break; } }