bugfix
This commit is contained in:
@@ -151,6 +151,7 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
onChoosePath( intent, key_type );
|
||||
} else if ( key_type == 10021 ) {
|
||||
if ( CustomNaviInterrupter.getInstance().interrupt() ) {
|
||||
// 导航过程中语音指令退出导航,会出现 activity 不走 onResume 的情况
|
||||
UiThreadHandler.postDelayed( () -> {
|
||||
if ( isForeground( getContext() ) && !hasOthersActivity() && !mStatusManager.isMainPageOnResume() ) {
|
||||
mLauncher.backToLauncher( getContext() );
|
||||
@@ -207,8 +208,15 @@ public class MapPresenter extends Presenter< MapView > implements
|
||||
|
||||
private boolean hasOthersActivity() {
|
||||
ActivityManager am = ( ActivityManager ) getContext().getSystemService( Context.ACTIVITY_SERVICE );
|
||||
List< ActivityManager.RunningTaskInfo > list = am.getRunningTasks( 2 );
|
||||
return list != null && list.size() > 1;
|
||||
List< ActivityManager.RunningTaskInfo > list = am.getRunningTasks( 1 );
|
||||
if ( list != null && !list.isEmpty() ) {
|
||||
for ( ActivityManager.RunningTaskInfo runningTaskInfo : list ) {
|
||||
if ( TextUtils.equals( runningTaskInfo.topActivity.getPackageName(), getContext().getPackageName() ) ) {
|
||||
return runningTaskInfo.numActivities > 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user