Skip to content
Advertisement

java.util.arraylist cannot be cast to java.lang.object[]

So in my code below, line marked with *** gives me the exception

java.util.arraylist cannot be cast to java.lang.object[]

I am trying to retrieve a list of users from backendless. I have created a list view that works when normally adding to list. but not when trying to get the response(Object)

JavaScript

Advertisement

Answer

what you are doing looks a bit long winded:

JavaScript

could be condenced to :

JavaScript

Next you will get an issue with:

JavaScript

because user.get(i)).getFirstName().toString() + ": " is a String which you are then casting to Type Learner. You will need to rethink this.

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement