I am very new to Android development and I am trying to use HashMap in an Android project. Now, I am making a sample project for learning android. I just store the keys and values ββin the HashMap, I want to show the keys and their values ββin the EditView. In my sample project, I used the code below. But, the first key and value is only to print in the EditView.
Map<String, String> map = new HashMap<String,String>(); map.put("iOS", "100"); map.put("Android", "101"); map.put("Java", "102"); map.put(".Net", "103"); Set keys = map.keySet(); for (Iterator i = keys.iterator(); i.hasNext(); ) { String key = (String) i.next(); String value = (String) map.get(key); textview.setText(key + " = " + value); }
In EditView iOS = 100 , only printing is performed. I want to print all the keys and their value in an EditText. Can someone please tell me where I am doing wrong? Thank you in advance.
java android hashmap key
Gopinath Jan 18 '12 at 12:05 2012-01-18 12:05
source share