setOnItemClickListener VS setOnItemSelectedListener in ListView.

后端 未结 5 432
隐瞒了意图╮
隐瞒了意图╮ 2021-01-04 05:20

I wish to set an onClickListener on items of a ListView but I see two methods setOnItemClickListener and setOnItemSelectedListener . I didint find

5条回答
  •  猫巷女王i
    2021-01-04 05:37

    I am not sure but it is my opinion.Might be wrong. setOnItemClickListener:Register a callback to be invoked when an item in this AdapterView has been clicked.It always return true.

    setOnItemSelectedListener:Register a callback to be invoked when an item in this AdapterView has been clicked.it return true and also false. If not selected any item then it will show nothing is selected.It is just force to user that select an option.Select an item and go next just kind of that. But when user forgot to select an item then if will remembered also user that he did not select any option.

提交回复
热议问题