私は自分のカスタムアダプタを作成しています。すべてのリスト項目の前にラジオボタンを置く必要があります。私はこれを使用します:ラジオボタン付きカスタムアダプタ
List<Address> result = myGeocoder.getFromLocationName(name,
MAX_RESULT);
public class MyArrayAdapter extends ArrayAdapter<Address> {
Context mycontext;
public MyArrayAdapter(Context context, int textViewResourceId,
List<Address> objects) {
super(context, textViewResourceId, objects);
mycontext = context;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
int maxAddressLineIndex = getItem(position)
.getMaxAddressLineIndex();
String addressLine = "";
for (int j = 0; j <= maxAddressLineIndex; j++) {
addressLine += getItem(position).getAddressLine(j) + ",";
}
TextView rowAddress = new TextView(mycontext);
rowAddress.setText(addressLine + "\n");
return rowAddress;
}
ラジオボタンを追加する方法は誰にでも分かります。
[質問] [1]の回答を確認してください。あなたと同じ。 [1]:http://stackoverflow.com/questions/4250599/android-listview-with-radiobutton-in-singlechoice-mode-and-a-custom-row-layout –