[6.5.0]
[fix] [relase 释放回调、并判空]
This commit is contained in:
@@ -43,6 +43,7 @@ public class NaviPresenter extends Presenter<TaxiRottingNaviFragment> implements
|
||||
|
||||
@Override
|
||||
public void onDestroy( @NonNull LifecycleOwner owner ) {
|
||||
releaseListeners();
|
||||
super.onDestroy( owner );
|
||||
}
|
||||
|
||||
@@ -54,24 +55,22 @@ public class NaviPresenter extends Presenter<TaxiRottingNaviFragment> implements
|
||||
TaxiModel.getInstance().setMoGoAutopilotPlanningListener(null);
|
||||
}
|
||||
|
||||
private void runOnUIThread( Runnable executor ) {
|
||||
if ( executor == null ) {
|
||||
return;
|
||||
}
|
||||
if ( Looper.myLooper() != Looper.getMainLooper() ) {
|
||||
UiThreadHandler.post( executor );
|
||||
} else {
|
||||
executor.run();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setLineMarker(LatLng startStation, LatLng endStation) {
|
||||
runOnUIThread(() -> mView.setLineMarker(startStation,endStation));
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if(mView!=null) {
|
||||
mView.setLineMarker(startStation, endStation);
|
||||
}
|
||||
}
|
||||
},UiThreadHandler.MODE.QUEUE);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void routeResult(List<LatLng> routeArrivied, List<LatLng> routeArriving, MogoLocation location) {
|
||||
mView.routeResult(routeArrivied,routeArriving,location);
|
||||
if(mView!=null) {
|
||||
mView.routeResult(routeArrivied, routeArriving, location);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user