hashmap cannot be cast to class

Hi,
I’m having a trouble when i try to get data from a table, the resulting object returns as a hashmap and somehow i cannot use it.

public void handleResponse(BackendlessCollection<MyObject> results) {

myobject.setText(results.getData().get(i).getText());

doesnt work ; HashMap cannot be cast to MyObject class.

I was able to get data but I don’t know what I did wrong this time.

Hi, Onur.

You can try to map data table to your class:

Backendless.Data.mapTableToClass( "MyTable", MyTable.class );

Regards,
Kate.