[Solved] retrieving the id of the view that was clicked [duplicate]


@Override 
public void onClick(View v){
switch(v.getId()){
    case R.id.btnCancel:
        //your code for onclick of that button
        break;
}

solved retrieving the id of the view that was clicked [duplicate]