ClassCastException: java.lang.Object[] cannot be cast to java.lang.String[] android

后端 未结 5 535
不知归路
不知归路 2020-12-24 10:17

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         


        
5条回答
  •  失恋的感觉
    2020-12-24 11:18

    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.

提交回复
热议问题