I have two editTextField, the same listener is attached to both of them. How would I figure out in the listener which one is clicked?
inputStart = (EditText)findViewById(R.id.editText3);
inputStart.setOnClickListener(TimePickerButtonOnClickListener);
inputEnd = (EditText)findViewById(R.id.editText4);
inputEnd.setOnClickListener(TimePickerButtonOnClickListener);
private Button.OnClickListener TimePickerButtonOnClickListener = new Button.OnClickListener() {
public void onClick(View v) { }
};
I have checked, one possible solution is in this question,
but I am looking for any property like EditText gotEditField = (EditText)v.targetEditField;
Does any such property exist?
View vfrom the parameters in youronCLickmethod is the view that was clicked.