routeto fix
followRoute ned UI thread
This commit is contained in:
parent
6b78bf7562
commit
6e8d6a52c1
1 changed files with 10 additions and 4 deletions
|
@ -60,15 +60,21 @@ public class OsMoDroidPlugin extends OsmandPlugin implements MonitoringInfoContr
|
||||||
}
|
}
|
||||||
|
|
||||||
public void reRouteTo(LatLon loc) {
|
public void reRouteTo(LatLon loc) {
|
||||||
OsmandApplication app = activity.getMyApplication();
|
final OsmandApplication app = activity.getMyApplication();
|
||||||
TargetPointsHelper targets = app.getTargetPointsHelper();
|
final TargetPointsHelper targets = app.getTargetPointsHelper();
|
||||||
// If we are in following mode then just update target point
|
// If we are in following mode then just update target point
|
||||||
targets.navigateToPoint(loc, true, -1);
|
targets.navigateToPoint(loc, true, -1);
|
||||||
if(!app.getRoutingHelper().isFollowingMode()) {
|
if(!app.getRoutingHelper().isFollowingMode()) {
|
||||||
// If we are not in following mode then request new route to calculate
|
// If we are not in following mode then request new route to calculate
|
||||||
// Use default application mode
|
// Use default application mode
|
||||||
activity.followRoute(app.getSettings().getApplicationMode(), targets.getPointToNavigate(), targets.getIntermediatePoints(),
|
activity.runOnUiThread(new Runnable() {
|
||||||
app.getLastKnownLocation(), null);
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
activity.followRoute(app.getSettings().getApplicationMode(), targets.getPointToNavigate(), targets.getIntermediatePoints(),app.getLastKnownLocation(), null);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue