辞書は使いません。廃止されました。ArrayListカスタムObjectのまたはの方がうまくいくと思いますHashMap。Object次に、あなたはあなたからこれを得ることができますAdapter:
listview.setOnItemClickListener(new OnItemClickListener() {
public void onItemClick(AdapterView<?> parent, View view, int position, long id) {
//adapter.getItem(position); - this is how you can acces the object
//connected to the selected item from the list
//Then you can easily access an id of this object (or from HashMap)
}
});
編集:xmlにリストが必要な場合は、いつでも抽象xmlファイルをリソースに追加できます。これらもローカライズできます。これは次のようになります。
<my_word>
<id>123</id>
<word>My word</word>
</my_word>
ただし、XML解析が含まれるため、必ずしも簡単なソリューションではありません。