setOnClickListener not working
hvar90 opened this issue · 1 comments
hvar90 commented
i try to use setOnClickListener on HoldingButtonLayout but it is not working
mHoldingButtonLayout.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
Toast toastN = Toast.makeText(ChatActivity.this, getString(
R.string.infoToRecord),
Toast.LENGTH_LONG);
toastN.setGravity(Gravity.CENTER, 0, 0);
toastN.show();
}
});
kudzaitsapo commented
i try to use setOnClickListener on HoldingButtonLayout but it is not working
mHoldingButtonLayout.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Toast toastN = Toast.makeText(ChatActivity.this, getString( R.string.infoToRecord), Toast.LENGTH_LONG); toastN.setGravity(Gravity.CENTER, 0, 0); toastN.show(); } });
What are you trying to achieve?
As for me, I put an imageview inside the HoldingButtonLayout, and then I listened for text change in edit text. On text change, I disabled the HoldingButtonLayout, and then listened for onClick on the imageview instead .... This works better than trying to listen for Onclick on the HoldingButtonLayout