I'm creating my own custom adapter. I have to put Radio button in front of every list item. I use this:
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;
}
Can anybody tell how can I add Radio button.