[問題] ListView的勾選問題

看板AndroidDev作者 (Frank)時間11年前 (2014/09/11 13:38), 編輯推噓1(101)
留言2則, 1人參與, 最新討論串1/1
各位大大好, 小弟想請問ListView若想把勾選的項目放入新陣列, 要用什麼語法? 我找了很久和想了很久, 我的ListView只有單純放文字陣列, 因為我要在最後一頁來呈現前面ListView勾選的項目,用Intent的Bundle把新陣列傳過去 但一直不知道怎麼把使用者所勾選的項目存入新陣列。 原本的寫法是 String Location [] = new location [count]; lstLocation.setChoiceMode(ListView.CHOICE_MODE_MULTIPLE); lstLocation.setAdapter(adapterBalls); count = adapterBalls.getCount(); for(int i = 0 ; i<count ; i++) { Location[i] = lstLocation.xxxxxx; } xxxxxx為我不知道該填入什麼 有試過select系列的, 希望有人可以幫我解答><緊急, 小弟新手,請包涵 -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 218.161.50.41 ※ 文章網址: http://www.ptt.cc/bbs/AndroidDev/M.1410413918.A.B21.html

09/11 14:00, , 1F
listview.getCheckedItemPosition()
09/11 14:00, 1F

09/11 14:00, , 2F
listview.getCheckedItemIds()
09/11 14:00, 2F
文章代碼(AID): #1K4JLUiX (AndroidDev)