在recyclerview
填充json
数据后,如果status_id = 1
我想设置onclicklistener,否则我不希望onclicklistener工作。
make your onClick method and call it from your recycler click listener...
just see the example:-
public void onClicked(){
if(id==1){
//your code for listener
}else{
//do anything
}
then call it from your on click of recyclerview....see
itemViewHolder.itemView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
onClicked();
}
}
});
In your onBindViewHolder
if(status.equals(1))
{
button.setClickable( true);
}
else
{
button.setClickable( false);
}
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.