PDA

View Full Version : [Android] Can't handle the SKRouteListener v2.5



Cyrilg
22.09.2015, 00:19
Hi all,

I want to launch a route calculation in a Fragment but my onAllRoutesCompleted implemented in the Fragment is not called
(yet, the route is well calculated because it is displayed and in the logcat I see the message W/SKMaps﹕ SKRouteManager---- @onAllRoutesCompleted called).

However, in another Activity called before my Fragment, which is an other step of my app, the SKRouteListener implemented in the Activity works very well.

I also tried this but it don't work.


route.setRouteMode(routeMode);
route.setRouteExposed(true);
route.setRequestAdvices(true);
route.setExtendedPointsReturned(false);

SKRouteManager.getInstance().clearCurrentRoute();

SKRouteManager.getInstance().setRouteListener(new SKRouteListener() {
@Override
public void onRouteCalculationCompleted(SKRouteInfo skRouteInfo) {
routeCalculationCompleted = skRouteInfo.getRouteID();
}

@Override
public void onRouteCalculationFailed(SKRoutingErrorCode skRoutingErrorCode) {
Log.e("RouteListener", skRoutingErrorCode.toString());
}

@Override
public void onAllRoutesCompleted() {
if(routeCalculationCompleted == -1) {
routeCalculationCompleted = 0;
}
}

@Override
public void onServerLikeRouteCalculationCompleted(SKRouteJsonA nswer skRouteJsonAnswer) {

}

@Override
public void onOnlineRouteComputationHanging(int i) {

}
});

SKRouteManager.getInstance().calculateRoute(route) ;

I hope you can help me.
Thanks a lot.
Cyril

Adela_Silvia
25.09.2015, 11:31
We've asked the help of our developers. We'll get back with a solution as soon as possible

Cyrilg
02.10.2015, 21:12
Hello,
Thanks, did you found something ? :)

Adela_Silvia
13.10.2015, 08:43
We didn't get any update from devs- let me check and I'll get back to you asap

Update [03.11.2015]: Please find here a demo project : https://www.dropbox.com/s/59p7o011mqiqm28/FragmentBasics.zip?dl=0 built by our developers, which provides an example of launching a route calculation in a fragment.