I have create an android application program..I dont know how to convert the ArrayList<HashMap<String,String>> mylist to string array..pls tell some idea.Thanks in advance

share|improve this question

12% accept rate
feedback

1 Answer

Create a new ArrayList<String>, traverse the "mylist", append one after one element into newly created list and finally use toArray(T[]) method of newly created list to obtain a string array.

share|improve this answer
You are right.But if he will create ArrayList<String>.He can directly add those into array.Is not it ? – Android Killer Sep 29 '11 at 5:29
@AndroidPower yes! of course. – AVD Sep 29 '11 at 5:31
So why should he create Arralist<String> ? He can take add the item directly to String array. – Android Killer Sep 29 '11 at 5:36
@AndroidPower - how she/he will determines the count of strings in that collection? – AVD Sep 29 '11 at 5:41
feedback

Your Answer

 
or
required, but never shown
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.