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.