How can i pass parameter to an OnClickListener() ?
Got my Listener:
OnClickListener myListener = new OnClickListener()
{
@Override
p
Another solution may be to not write the code directly inside onClick() method, alternatively, write the code in a separate method, and then call that method in onClick().
Example:
button.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
function();
}
});
private void function() {
//your code here
}