The Method Setonclicklistener(view.onclicklistener) In The Type View Is Not Applicable For The Arguments (new Dialoginterface.onclicklistener(){})
Attempting to add an onClickListener to items in my listView and I'm getting an error stating: 'The method setOnClickListener(View.OnClickListener) in the type View is not applicab
Solution 1:
you probably have the wrong import. Check if you imported DialogInterface.OnClickListener. Still you can explicitly force the parameter this way:
holder.imageView.setOnClickListener(newView.OnClickListener() {
publicvoidonClick(View v) {
Toast.makeText(context, "Clicked on image",
Toast.LENGTH_LONG).show();
}
Post a Comment for "The Method Setonclicklistener(view.onclicklistener) In The Type View Is Not Applicable For The Arguments (new Dialoginterface.onclicklistener(){})"