I want to have an example String[] images like the below dynamically, but i cannot achieve it
String[] images = new String[] { "http://image/image1", "http://image/image1", "http://image/image1"};
I have a json where it contains the image urls, below code is how i am tryig to put the json image urls to the string[] images
String[] images = new String[]{};
for (int i = 0; i < contacts.length(); i++) {
JSONObject c = contacts.getJSONObject(i);
String imagepath = c.getString("imagepath");
images[i] = imagepath; // trying to put the values to String[] images
}
newURLyou may need to assignimagepathright ?imagepathnot thenewURL