Get a GeoPoint from a table in backendless?

Hi,
Well my problem is: i have my table Solicitud like the image
I can update and create new rows with no problems, but when i try to retrieve the table it throws me an NullPointerException:

FATAL EXCEPTION: main
 Process: com.sdevelop.taxionline, PID: 17207
 java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.Double com.backendless.geo.GeoPoint.getLatitude()' on a null object reference

This is my method:

Backendless.Persistence.of(Solicitud.class).find(dataQuery, new
 AsyncCallback<BackendlessCollection<Solicitud>>() {
 @Override
 public void handleResponse(BackendlessCollection<Solicitud> solicitudBackendlessCollection) {
 Log.d("objetos recibidos ", ""+solicitudBackendlessCollection.getTotalObjects());
 for( Solicitud sol : solicitudBackendlessCollection.getData() ){
 GeoPoint gp = sol.getUbicacion();
 mMap.addMarker(new MarkerOptions()
 .position(new LatLng(gp.getLatitude(), gp.getLongitude()))
 .title(""+sol.getNombreUsuario())
 .snippet(""+sol.getPuntoReferencia())
 .icon(BitmapDescriptorFactory.defaultMarker(BitmapDescriptorFactory.HUE_GREEN)));
 Log.d("Agregando Punto: ", "Nombre Usuario: "+sol.getNombreUsuario()+" Lat: "+gp.getLatitude()+" Long: "+gp.getLongitude());
 }

In the line 5 i ask how many rows i have in the response, it says that i have 2 rows and i can get the NombreUsuario but the GeoPoint comes null.
Sorry for my bad english.
Thanks a lot.

Hi Adan,

You need to add the names of the relation properties into the request so the server includes them into the response (by default Backendless does not return relations). Here’s what it will look like with the change:

QueryOptions queryOptions = new QueryOptions();
queryOptions.addRelated( "ubicacion" );
dataQuery.setQueryOptions( queryOptions )
Backendless.Persistence.of(Solicitud.class).find(dataQuery.....

Regards,
Mark

Thank you very much Mark you’re doing an excelent job with this platform .