We’re getting the following exception.
Android SDK version : Backendless SDK v1.10 for Android, released 08.11.2014.
Business Logic - Geo Service Handler - afterGetCategories() -> cast Exceptio
@Override
public void afterGetCategories(RunnerContext context, ExecutionResult<List<GeoCategory>> result) throws Exception {
System.out.println("GenericGeoCategoryEventHandler.afterGetCategories()");
List<GeoCategory> geoCategories = result.getResult(); // Exception here
for (GeoCategory geoCategory : geoCategories) {
System.out.println(" result=" + geoCategory);
}
}
GenericGeoCategoryEventHandler.afterGetCategories()
[Lcom.backendless.geo.GeoCategory; cannot be cast to java.util.List
java.lang.reflect.InvocationTargetException
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at com.backendless.coderunner.runtime.InvocationTask.run(InvocationTask.java:101)
at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
at java.lang.Thread.run(Unknown Source)
Caused by: java.lang.ClassCastException: [Lcom.backendless.geo.GeoCategory; cannot be cast to java.util.List
at com.backendless.demo.events.geo_service.GenericGeoCategoryEventHandler.afterGetCategories(GenericGeoCategoryEventHandler.java:84)
... 8 more