In my application I need to convert my arraylist to a string of an array. However, I am getting an error:
ClassCastException: java.lang.Object[] cannot be ca
listofurls = image_urls.toArray(new String[0]);
that should do the trick for all cases, even if you don't know the size of the resulting array.