Hey. I have the activity:
public class Mtest extends Activity {
Button b1;
Button b2;
public void onCreate(Bundle savedInstanceState) {
...
b1 = (Button) findViewById(R.id.b1);
b2 = (Button) findViewById(R.id.b2);
b1.setOnClickListener(myhandler);
b2.setOnClickListener(myhandler);
...
}
View.OnClickListener myhandler = new View.OnClickListener() {
public void onClick(View v) {
// MY QUESTION STARTS HERE!!!
// IF b1 do this
// IF b2 do this
// MY QUESTION ENDS HERE!!!
}
}
}
How do I check which button has been clicked?