{final Button tab3button2 = view findViewById(R.id.button2); View.OnClickListener() { @Override pubilc void onClick (View v)
I have tried searching for answers but all to no avail.
{final Button tab3button2 = view findViewById(R.id.button2); View.OnClickListener() { @Override pubilc void onClick (View v)
I have tried searching for answers but all to no avail.
Here is what you need, I edited your code:
final Button tab3button2 = view findViewById(R.id.button2);
tab3button2.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View _view) {
here put the blocks that will be executed when the button gets clicked
}
});
it's recommended to add this code in the onCreate
event, but if this Button
is in a ListView
custom view then add it in the onBindCustomView
event.
Just copy the code for on click on source code, and you must have a section like bindview or webview to get at the id of widget. Then just enter I'd, make sure it's different then all others on same page.