I have a problem trying to use the method calcularRuta from outside an activity. The method returns a value depending on the inputs it has. I can't get any results because i tried debugging it and it doesn't even enter the method, so it when i have to use the variable ruta in the next line it's null.
public boolean onTouch(View v, MotionEvent event) {
try {
String qr = DecodeQR.zxing(mRgba);
int origen = Integer.valueOf(qr);
int destino = Integer.valueOf(bundle.getString("DESTINO"));
boolean ascensor = bundle.getBoolean("ASCENSOR");
if (ruta == null)
ruta = IniciarBusqueda.calcularRuta(origen, destino, ascensor);
updateScreen(qr, ruta.toString());
} catch (ChecksumException e) {
e.printStackTrace();
} catch (FormatException e) {
e.printStackTrace();
}
return false;
}
I'm trying to figure out what is the problem but i can't... Any thoughts?
Thanks.
EDIT: Changed the utility method to static.