[Solved] Set value for Spinner with custom Adapter in Android

@Haresh Chhelana example is good, However if you want to show both name and code in spinner after selecting, check this out. List<Map<String, String>> items = new ArrayList<Map<String, String>>(); for (int i = 0; i < JA.length(); i++) { json = JA.getJSONObject(i); mapData = new HashMap<String, String>(); mapData.put(“name”, json.getString(“Name”)); mapData.put(“code”, json.getString(“Code”)); items.add(mapData); } SimpleAdapter adapter … Read more