Why is ListView.getCheckedItemPositions() not returning correct values?

前端 未结 15 1936
北海茫月
北海茫月 2020-11-29 06:01

The app has a ListView with multiple-selection enabled, in the UI it works as expected. But when I read the values out using this code:

Log.         


        
15条回答
  •  离开以前
    2020-11-29 06:17

    It happens if you do not choose the correct resource for showing your different items. It works fine if you choose the built-in resource android.R.layout.simple_list_item_multiple_choice. The method getCheckedItemPositions is coupled in some way to the built-in resource.

提交回复
热议问题