Possible Duplicate:
How can I convert String[] to ArrayList<String>
hi please can anyone help me I have :
private String results[];
private ArrayList<String> alist;
I want convert
String results[] to ArrayList<String>
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Try this:
What this does is, it constructs an ArrayList of Strings called aList:
ArrayList<String> aList = new ArrayList<String>();And then, for every String in results:
String s : resultsIt add’s that string:
aList.add(s);.Hope this helps!