私のアプリケーションではをサーバから取得し、このリストを表示します。私はどのようにAndroidでArrayListの項目を取得できますか
私は以下のコードを書いている:私はそれが正しいだとショーは、データのユーザーには、このデータを表示すると、私はこの項目をクリックすると
private String[] mostlyMatchedKeywordsStrings;
mostlyMatchedKeywordsStrings = searchResponse.getData().getMostlyMatchedKeywordsText();
cloudChipList.clear();
fullSearchMini_chipCloud.removeAllViews();
for (int i = 0; i < mostlyMatchedKeywordsStrings.length; i++) {
cloudChipList.add(mostlyMatchedKeywordsStrings[i]);
if (i >= mostlyMatchedKeywordsStrings.length - 2) {
fullSearchMini_didYouMeanLay.setVisibility(View.VISIBLE);
fullSearchMini_chipCloud.addChip(mostlyMatchedKeywordsStrings[i]);
Log.e("searchKeys", mostlyMatchedKeywordsStrings[i]);
fullSearchMini_chipCloud.setChipListener(new ChipListener() {
@Override
public void chipSelected(int i) {
try {
Log.e("searchKeys", "new : " + mostlyMatchedKeywordsStrings[i]);
}
catch (Exception e) {
}
}
@Override
public void chipDeselected(int i) {
}
});
}
}
、しかし、それは別のアイテム私を示しています! Logcatで
それが項目の下に私を示しています
searchKeys: Recep Ivedik 5
しかし、私はこの項目をクリックすると、それは私にlogcatで別の項目を示しています。アイテムを表示するには
searchKeys: new : Recep Ivedik 3
をし、私はこのコードmostlyMatchedKeywordsStrings[i]
を使用しています。なぜlogCatでこのアイテムをクリックすると別のアイテムが表示されるのですか?
を? if(i> = mostlyMatchedKeywordsStrings.length - 2) – firegloves
@firegloves、私はちょうど2最後の項目を表示します。すべての商品を表示しないちょうど2最後に。手伝って頂けますか? –