I am validating the EditText value by clicking anywhere inside the window. But for some buttons, I want to do something different from the validation functionality. How can I get the id of the item from the layout action. Here my layout is ConstraintLayout. Tried the below code but it's not working.
window_layout.setOnClickListener(new
View.OnClickListener() {
@Override
public void onClick(View v) {
switch (v.getId()) {
case R.id.btn_tech:
setButtonsVisibility();
break;
}
}
});
Please suggest a better way to implement that.