setOnItemClickListener VS setOnItemSelectedListener ListView中。VS、setOnItemClickListener、ListView、set

2023-09-06 04:01:25 作者:丶你的爱,用不起

我想在一个ListView的项目设置onClickListener但我看到两个方法 setOnItemClickListener setOnItemSelectedListener 。我didint找到任何合理的解释,这两个官方文档。哪一个用于什么目的?

I wish to set an onClickListener on items of a ListView but I see two methods setOnItemClickListener and setOnItemSelectedListener . I didint find any justified explanation for these two in official docs. Which one to use for what purpose?

要选择一个项目,用户必须点击该项目,然后有什么用不同的方法?

To select an item, the user will have to click the item then what is the use of different methods?

推荐答案

这就像

该项目被点击(单选)与该项目被选中(在多个选择中使用)

the item is clicked (single selection) vs the item is selected (used in multiple selection)