[6.1.2] 修复因切主线程开启高德anr问题
This commit is contained in:
@@ -343,20 +343,15 @@ public class TaxiBeingServerdOrdersFragment extends BaseTaxiUIFragment
|
||||
}
|
||||
|
||||
private void startNaviToStation(boolean isVoicePlay, double stationLat, double stationLng) {
|
||||
UiThreadHandler.post(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).destroyAmaNavi();
|
||||
double mCurLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
|
||||
double mCurLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
|
||||
|
||||
double mCurLatitude = CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLatitude();
|
||||
double mCurLongitude =CallerChassisLocationGCJ02ListenerManager.INSTANCE.getChassisLocationGCJ02().getLongitude();
|
||||
CallerLogger.d(M_TAXI + TAG, "currentLatLng=" + mCurLatitude + " " +mCurLongitude);
|
||||
|
||||
CallerLogger.d(M_TAXI + TAG, "currentLatLng=" + mCurLatitude + " " +mCurLongitude);
|
||||
NaviLatLng startNaviLatLng = new NaviLatLng(mCurLatitude, mCurLongitude);
|
||||
NaviLatLng endNaviLatLng = new NaviLatLng(stationLat, stationLng);
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng);
|
||||
}
|
||||
});
|
||||
NaviLatLng startNaviLatLng = new NaviLatLng(mCurLatitude, mCurLongitude);
|
||||
NaviLatLng endNaviLatLng = new NaviLatLng(stationLat, stationLng);
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).initAMapNavi(startNaviLatLng, endNaviLatLng);
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).setVoiceIsMute(isVoicePlay);
|
||||
AmapNaviToDestinationModel.getInstance(getContext()).setTaxiNaviChangedCallback(this);
|
||||
}
|
||||
|
||||
@@ -599,20 +599,18 @@ class TaxiCurrentTaskFragment : BaseFragment(),
|
||||
}
|
||||
|
||||
private fun startNaviToStation(isVoicePlay: Boolean, stationLat: Double, stationLng: Double) {
|
||||
UiThreadHandler.post{
|
||||
AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi()
|
||||
val mCurLatitude = getChassisLocationGCJ02().latitude
|
||||
val mCurLongitude = getChassisLocationGCJ02().longitude
|
||||
d(
|
||||
TAG,
|
||||
"currentLatLng=$mCurLatitude $mCurLongitude"
|
||||
)
|
||||
val startNaviLatLng = NaviLatLng(mCurLatitude, mCurLongitude)
|
||||
val endNaviLatLng = NaviLatLng(stationLat, stationLng)
|
||||
AmapNaviToDestinationModel.getInstance(context).initAMapNavi(startNaviLatLng, endNaviLatLng)
|
||||
AmapNaviToDestinationModel.getInstance(context).setVoiceIsMute(isVoicePlay)
|
||||
AmapNaviToDestinationModel.getInstance(context).setTaxiNaviChangedCallback(this)
|
||||
}
|
||||
AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi()
|
||||
val mCurLatitude = getChassisLocationGCJ02().latitude
|
||||
val mCurLongitude = getChassisLocationGCJ02().longitude
|
||||
d(
|
||||
TAG,
|
||||
"currentLatLng=$mCurLatitude $mCurLongitude"
|
||||
)
|
||||
val startNaviLatLng = NaviLatLng(mCurLatitude, mCurLongitude)
|
||||
val endNaviLatLng = NaviLatLng(stationLat, stationLng)
|
||||
AmapNaviToDestinationModel.getInstance(context).initAMapNavi(startNaviLatLng, endNaviLatLng)
|
||||
AmapNaviToDestinationModel.getInstance(context).setVoiceIsMute(isVoicePlay)
|
||||
AmapNaviToDestinationModel.getInstance(context).setTaxiNaviChangedCallback(this)
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user