This commit is contained in:
wangcongtao
2020-07-08 15:27:27 +08:00
parent ab92ce6d55
commit 8804612d0a
2 changed files with 14 additions and 2 deletions

View File

@@ -127,6 +127,10 @@ android {
buildConfigField 'int', 'NET_ENV', '4'
}
}
packagingOptions {
exclude 'META-INF/io.netty.versions.properties'
}
}
def generateVersionCode() {

View File

@@ -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;
}
/**