开发者

Disableing Android listview

I have a view with a listview and several other views including a button and a few e开发者_如何学JAVAdittexts. I want the listview to be scrollable but not clickable after i press the button. Any suggestions?


I would add a field, something like:

private boolean clicked = false;

I would then go into the onClick method and add something like

    if(!clicked){
//Do Stuff on the click
    clicked = true;
}
else if(clicked){
//do nothing
}

then to accept a click again you would first have to set clicked to false again, and then continue to accept clicks.


You need disable the clicklisteners for the listview by calling setOnClickListener to null , @Aaron Decker's solution is good too :-)

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜