Parcourir la source

优化可能会出现问题的代码

lhm il y a 3 ans
Parent
commit
fd5017140d

+ 1 - 1
app/build.gradle

@@ -39,7 +39,7 @@ android {
             buildConfigField "String", "ICSP_HOST", "\"http://icsp-api.ds-bay.com\""
         }
         debug {
-            minifyEnabled true
+            minifyEnabled false
             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
             buildConfigField "String", "EMQX_HOST", "\"tcp://183.3.221.143:1883\""
             buildConfigField "String", "ICSP_HOST", "\"http://icsp-testend.ds-bay.com\""

+ 7 - 6
app/src/main/java/com/emato/ich/fragment/ChooseCabinetFragment.java

@@ -18,6 +18,8 @@ import androidx.annotation.NonNull;
 import androidx.annotation.Nullable;
 import androidx.fragment.app.Fragment;
 import androidx.fragment.app.FragmentActivity;
+import androidx.navigation.NavBackStackEntry;
+import androidx.navigation.NavController;
 import androidx.navigation.fragment.NavHostFragment;
 
 import com.emato.ich.MainActivity;
@@ -36,6 +38,7 @@ import com.emato.ich.utils.BaseUtils;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.JacksonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.TimeOutUtils;
 import com.emato.ich.utils.ToastUtils;
@@ -206,9 +209,9 @@ public class ChooseCabinetFragment extends Fragment {
                 timer.cancel();
             }
             if (null != exceptionBundle) {
-                NavHostFragment.findNavController(ChooseCabinetFragment.this).navigate(R.id.action_chooseCabinetFragment_to_exceptionFragment);
+                NavUtils.navigate(this, R.id.action_chooseCabinetFragment_to_exceptionFragment);
             } else {
-                NavHostFragment.findNavController(ChooseCabinetFragment.this).navigate(R.id.action_chooseCabinetFragment_to_sendMainFragment);
+                NavUtils.navigate(this, R.id.action_chooseCabinetFragment_to_sendMainFragment);
             }
         });
     }
@@ -278,8 +281,7 @@ public class ChooseCabinetFragment extends Fragment {
                                                         if (null != timer) {
                                                             timer.cancel();
                                                         }
-                                                        NavHostFragment.findNavController(ChooseCabinetFragment.this)
-                                                                .navigate(R.id.action_chooseCabinetFragment_to_sendInfoConfirmFragment);
+                                                        NavUtils.navigate(ChooseCabinetFragment.this, R.id.action_chooseCabinetFragment_to_sendInfoConfirmFragment);
                                                     } catch (RuntimeException e) {
                                                         Log.e(TAG, "onResponse: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
                                                         LoggingUtils.sendErrorLog("业务异常: InputInfoFragment页面获取SendInfoConfirmFragment传值错误! ", e);
@@ -312,8 +314,7 @@ public class ChooseCabinetFragment extends Fragment {
                     timer.cancel();
                 }
                 activity.getBundleMap().put(ChooseCabinetFragment.class.getName(), bundle);
-                NavHostFragment.findNavController(ChooseCabinetFragment.this)
-                        .navigate(R.id.action_chooseCabinetFragment_to_inputInfoFragment, bundle);
+                NavUtils.navigate(this, R.id.action_chooseCabinetFragment_to_inputInfoFragment, bundle);
             }
 
         } catch (RuntimeException | JsonProcessingException e) {

+ 5 - 7
app/src/main/java/com/emato/ich/fragment/ExceptionFragment.java

@@ -27,6 +27,7 @@ import com.emato.ich.utils.BaseUtils;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.JacksonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.TimeOutUtils;
 import com.emato.ich.utils.ToastUtils;
@@ -102,7 +103,7 @@ public class ExceptionFragment extends Fragment {
             if (null != timer) {
                 timer.cancel();
             }
-            NavHostFragment.findNavController(ExceptionFragment.this).navigate(R.id.action_exceptionFragment_to_ChooseCabinetFragment);
+            NavUtils.navigate(this, R.id.action_exceptionFragment_to_ChooseCabinetFragment);
         });
         // 门没开换柜门
         binding.issueDoorNotOpen.setOnClickListener(view1 -> {
@@ -152,11 +153,9 @@ public class ExceptionFragment extends Fragment {
             if (null != bundle) {
                 // 跳转确认投递页面
                 finalActivity.getBundleMap().remove(SendInfoConfirmFragment.class.getName());
-                NavHostFragment.findNavController(ExceptionFragment.this)
-                        .navigate(R.id.action_exceptionFragment_to_sendInfoConfirmMainFragment);
+                NavUtils.navigate(this, R.id.action_exceptionFragment_to_sendInfoConfirmMainFragment);
             } else {
-                NavHostFragment.findNavController(ExceptionFragment.this)
-                        .navigate(R.id.action_exceptionFragment_to_sendMainFragment);
+                NavUtils.navigate(this, R.id.action_exceptionFragment_to_sendMainFragment);
             }
         });
     }
@@ -222,8 +221,7 @@ public class ExceptionFragment extends Fragment {
                                                             if (null != timer) {
                                                                 timer.cancel();
                                                             }
-                                                            NavHostFragment.findNavController(ExceptionFragment.this)
-                                                                    .navigate(R.id.action_exceptionFragment_to_sendSuccessFragment);
+                                                            NavUtils.navigate(ExceptionFragment.this, R.id.action_exceptionFragment_to_sendSuccessFragment);
                                                             break;
                                                         case DecisionConstant.REOPEN_01:
                                                             // 大小不合适

+ 3 - 3
app/src/main/java/com/emato/ich/fragment/InputInfoFragment.java

@@ -28,6 +28,7 @@ import com.emato.ich.local.LocalStorage;
 import com.emato.ich.utils.BaseUtils;
 import com.emato.ich.utils.JacksonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.TimeOutUtils;
 import com.emato.ich.utils.ToastUtils;
@@ -230,7 +231,7 @@ public class InputInfoFragment extends Fragment {
                                             if (null != timer) {
                                                 timer.cancel();
                                             }
-                                            NavHostFragment.findNavController(InputInfoFragment.this).navigate(R.id.action_inputInfoFragment_to_sendInfoConfirmFragment);
+                                            NavUtils.navigate(InputInfoFragment.this, R.id.action_inputInfoFragment_to_sendInfoConfirmFragment);
                                         }
                                         Log.i(TAG, "onResponse: ICSP返回码: " + responseData.getCode() + ", 返回信息: " + responseData.getMsg());
                                         ToastUtils.make(getContext(), responseData.getMsg());
@@ -426,8 +427,7 @@ public class InputInfoFragment extends Fragment {
             if (null != timer) {
                 timer.cancel();
             }
-            NavHostFragment.findNavController(InputInfoFragment.this)
-                    .navigate(R.id.action_inputInfoFragment_to_chooseCabinetFragment);
+            NavUtils.navigate(this, R.id.action_inputInfoFragment_to_chooseCabinetFragment);
         });
     }
 

+ 5 - 4
app/src/main/java/com/emato/ich/fragment/MainFragment.java

@@ -2,6 +2,8 @@ package com.emato.ich.fragment;
 
 import android.graphics.drawable.Drawable;
 import android.os.Bundle;
+
+import com.emato.ich.local.LocalStorage;
 import com.emato.ich.utils.Log;
 import android.view.LayoutInflater;
 import android.view.View;
@@ -18,6 +20,7 @@ import com.emato.ich.contant.SystemConfigConstant;
 import com.emato.ich.databinding.FragmentMainBinding;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.StringUtils;
 
 import org.jetbrains.annotations.NotNull;
@@ -86,16 +89,14 @@ public class MainFragment extends Fragment {
             if (ButtonUtils.isFastClick()) {
                 return;
             }
-            NavHostFragment.findNavController(MainFragment.this)
-                    .navigate(R.id.action_mainFragment_to_sendFragment);
+            NavUtils.navigate(this, R.id.action_mainFragment_to_sendFragment);
         });
         // 取件页面跳转
         binding.takeBtn.setOnClickListener(view1 -> {
             if (ButtonUtils.isFastClick()) {
                 return;
             }
-            NavHostFragment.findNavController(MainFragment.this)
-                    .navigate(R.id.action_mainFragment_to_takeFragment);
+            NavUtils.navigate(this, R.id.action_mainFragment_to_takeFragment);
         });
     }
 

+ 3 - 3
app/src/main/java/com/emato/ich/fragment/SendFragment.java

@@ -27,6 +27,7 @@ import com.emato.ich.utils.BaseUtils;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.JacksonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.TimeOutUtils;
 import com.emato.ich.utils.ToastUtils;
@@ -247,7 +248,7 @@ public class SendFragment extends Fragment {
                                         if (null != timer) {
                                             timer.cancel();
                                         }
-                                        NavHostFragment.findNavController(SendFragment.this).navigate(R.id.action_sendFragment_to_sendMainFragment);
+                                        NavUtils.navigate(SendFragment.this, R.id.action_sendFragment_to_sendMainFragment);
                                     } else {
                                         ToastUtils.make(getContext(), responseData.getMsg());
                                         Log.w(TAG, "onResponse: " + responseData.getMsg());
@@ -397,8 +398,7 @@ public class SendFragment extends Fragment {
             if (null != timer) {
                 timer.cancel();
             }
-            NavHostFragment.findNavController(SendFragment.this)
-                    .navigate(R.id.action_sendFragment_to_mainFragment);
+            NavUtils.navigate(this, R.id.action_sendFragment_to_mainFragment);
         });
 
 

+ 5 - 8
app/src/main/java/com/emato/ich/fragment/SendInfoConfirmFragment.java

@@ -27,6 +27,7 @@ import com.emato.ich.utils.BaseUtils;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.JacksonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.TimeOutUtils;
 import com.emato.ich.utils.ToastUtils;
@@ -147,8 +148,7 @@ public class SendInfoConfirmFragment extends Fragment {
                                     if (null != timer) {
                                         timer.cancel();
                                     }
-                                    NavHostFragment.findNavController(SendInfoConfirmFragment.this)
-                                            .navigate(R.id.action_sendInfoConfirmFragment_to_sendSuccessFragment);
+                                    NavUtils.navigate(SendInfoConfirmFragment.this, R.id.action_sendInfoConfirmFragment_to_sendSuccessFragment);
                                 } else {
                                     // TODO 确认投递失败逻辑处理
                                     ToastUtils.make(getContext(), responseData.getMsg());
@@ -183,8 +183,7 @@ public class SendInfoConfirmFragment extends Fragment {
             }
             bundle.putString("exception", "exception_page");
             finalActivity.getBundleMap().put(SendInfoConfirmFragment.class.getName(), bundle);
-            NavHostFragment.findNavController(SendInfoConfirmFragment.this)
-                    .navigate(R.id.action_sendInfoConfirmFragment_to_exceptionFragment);
+            NavUtils.navigate(this, R.id.action_sendInfoConfirmFragment_to_exceptionFragment);
         });
 
         // 未投递按钮
@@ -220,8 +219,7 @@ public class SendInfoConfirmFragment extends Fragment {
                                         if (null != timer) {
                                             timer.cancel();
                                         }
-                                        NavHostFragment.findNavController(SendInfoConfirmFragment.this)
-                                                .navigate(R.id.action_sendInfoConfirmFragment_to_sendSuccessFragment);
+                                        NavUtils.navigate(SendInfoConfirmFragment.this, R.id.action_sendInfoConfirmFragment_to_sendSuccessFragment);
                                     } catch (Exception e) {
 
                                     }
@@ -251,8 +249,7 @@ public class SendInfoConfirmFragment extends Fragment {
                             isException = true;
                         }
                         LocalStorage.getInstance().cleanSession(((MainActivity) getActivity()), isException);
-                        NavHostFragment.findNavController(SendInfoConfirmFragment.this)
-                                .navigate(R.id.action_sendInfoConfirmFragment_to_mainFragment);
+                        NavUtils.navigate(this, R.id.action_sendInfoConfirmFragment_to_mainFragment);
                     })).setNegativeButton("取消", ((dialog, which) -> {
                         dialog.dismiss();
                     })).create();

+ 4 - 6
app/src/main/java/com/emato/ich/fragment/SendMainFragment.java

@@ -17,6 +17,7 @@ import com.emato.ich.R;
 import com.emato.ich.databinding.FragmentSendMainBinding;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.TimeOutUtils;
 
 import org.jetbrains.annotations.NotNull;
@@ -70,8 +71,7 @@ public class SendMainFragment extends Fragment {
             if (null != timer) {
                 timer.cancel();
             }
-            NavHostFragment.findNavController(SendMainFragment.this)
-                    .navigate(R.id.action_sendMainFragment_to_chooseCabinetFragment);
+            NavUtils.navigate(this, R.id.action_sendMainFragment_to_chooseCabinetFragment);
         });
         // 异常处理
         binding.exceptionHandleBtn.setOnClickListener(view1 -> {
@@ -81,8 +81,7 @@ public class SendMainFragment extends Fragment {
             if (null != timer) {
                 timer.cancel();
             }
-            NavHostFragment.findNavController(SendMainFragment.this)
-                    .navigate(R.id.action_sendMainFragment_to_exceptionFragment);
+            NavUtils.navigate(this, R.id.action_sendMainFragment_to_exceptionFragment);
         });
         binding.returnBtn.setOnClickListener(view1 -> {
             if (ButtonUtils.isFastClick()) {
@@ -91,8 +90,7 @@ public class SendMainFragment extends Fragment {
             if (null != timer) {
                 timer.cancel();
             }
-            NavHostFragment.findNavController(SendMainFragment.this)
-                    .navigate(R.id.action_sendMainFragment_to_sendFragment);
+            NavUtils.navigate(this, R.id.action_sendMainFragment_to_sendFragment);
         });
     }
 

+ 4 - 6
app/src/main/java/com/emato/ich/fragment/SendSuccessFragment.java

@@ -18,6 +18,7 @@ import com.emato.ich.databinding.FragmentSendSuccessBinding;
 import com.emato.ich.local.LocalStorage;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.TimeOutUtils;
 
 import org.jetbrains.annotations.NotNull;
@@ -66,8 +67,7 @@ public class SendSuccessFragment extends Fragment {
             }
             // 继续投递重新计算异常处理次数
             LocalStorage.getInstance().getSession().setException(true);
-            NavHostFragment.findNavController(SendSuccessFragment.this)
-                    .navigate(R.id.action_sendSuccessFragment_to_chooseCabinetFragment);
+            NavUtils.navigate(this, R.id.action_sendSuccessFragment_to_chooseCabinetFragment);
         });
 
         // 退出账号
@@ -81,8 +81,7 @@ public class SendSuccessFragment extends Fragment {
             if (null != timer) {
                 timer.cancel();
             }
-            NavHostFragment.findNavController(SendSuccessFragment.this)
-                    .navigate(R.id.action_sendSuccessFragment_to_mainFragment);
+            NavUtils.navigate(this, R.id.action_sendSuccessFragment_to_mainFragment);
         });
 
         binding.returnMainBtn.setOnClickListener(view1 -> {
@@ -94,8 +93,7 @@ public class SendSuccessFragment extends Fragment {
             }
             MainActivity activity = (MainActivity) getActivity();
             LocalStorage.getInstance().cleanSession(activity, false);
-            NavHostFragment.findNavController(SendSuccessFragment.this)
-                    .navigate(R.id.action_sendSuccessFragment_to_mainFragment);
+            NavUtils.navigate(this, R.id.action_sendSuccessFragment_to_mainFragment);
         });
 
     }

+ 3 - 3
app/src/main/java/com/emato/ich/fragment/TakeCodeFragment.java

@@ -29,6 +29,7 @@ import com.emato.ich.entity.vo.TakeParcelVo;
 import com.emato.ich.utils.BaseUtils;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.JacksonUtils;
 import com.emato.ich.utils.TimeOutUtils;
@@ -276,7 +277,7 @@ public class TakeCodeFragment extends Fragment {
                                         if (null != timer) {
                                             timer.cancel();
                                         }
-                                        NavHostFragment.findNavController(TakeCodeFragment.this).navigate(R.id.action_takeCodeFragment_to_takeSuccessFragment);
+                                        NavUtils.navigate(TakeCodeFragment.this, R.id.action_takeCodeFragment_to_takeSuccessFragment);
                                     }
                                 } catch (RuntimeException e) {
                                     Log.e(TAG, "onResponse: 取件失败! ", e);
@@ -301,8 +302,7 @@ public class TakeCodeFragment extends Fragment {
             if (null != timer) {
                 timer.cancel();
             }
-            NavHostFragment.findNavController(TakeCodeFragment.this)
-                    .navigate(R.id.action_takeCodeFragment_to_takeFragment);
+            NavUtils.navigate(this, R.id.action_takeCodeFragment_to_takeFragment);
         });
         binding.editTextTextPersonName6.requestFocus();
     }

+ 3 - 4
app/src/main/java/com/emato/ich/fragment/TakeFragment.java

@@ -20,6 +20,7 @@ import com.emato.ich.contant.SystemConfigConstant;
 import com.emato.ich.databinding.FragmentTakeBinding;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.TimeOutUtils;
 
@@ -104,8 +105,7 @@ public class TakeFragment extends Fragment {
             if (null != timer) {
                 timer.cancel();
             }
-            NavHostFragment.findNavController(TakeFragment.this)
-                    .navigate(R.id.action_takeFragment_to_takeCodeFragment);
+            NavUtils.navigate(this, R.id.action_takeFragment_to_takeCodeFragment);
         });
         binding.returnBtn.setOnClickListener(view1 -> {
             if (ButtonUtils.isFastClick()) {
@@ -114,8 +114,7 @@ public class TakeFragment extends Fragment {
             if (null != timer) {
                 timer.cancel();
             }
-            NavHostFragment.findNavController(TakeFragment.this)
-                    .navigate(R.id.action_takeFragment_to_mainFragment);
+            NavUtils.navigate(this, R.id.action_takeFragment_to_mainFragment);
         });
     }
 

+ 3 - 4
app/src/main/java/com/emato/ich/fragment/TakeSuccessFragment.java

@@ -26,6 +26,7 @@ import com.emato.ich.utils.BaseUtils;
 import com.emato.ich.utils.ButtonUtils;
 import com.emato.ich.utils.JacksonUtils;
 import com.emato.ich.utils.LoggingUtils;
+import com.emato.ich.utils.NavUtils;
 import com.emato.ich.utils.StringUtils;
 import com.emato.ich.utils.TimeOutUtils;
 import com.emato.ich.utils.ToastUtils;
@@ -85,8 +86,7 @@ public class TakeSuccessFragment extends Fragment {
                 timer.cancel();
             }
             timer2.cancel();
-            NavHostFragment.findNavController(TakeSuccessFragment.this)
-                    .navigate(R.id.action_takeSuccessFragment_to_takeCodeFragment);
+            NavUtils.navigate(this, R.id.action_takeSuccessFragment_to_takeCodeFragment);
         });
 
         binding.returnMainBtn.setOnClickListener(view1 -> {
@@ -101,8 +101,7 @@ public class TakeSuccessFragment extends Fragment {
             }
             MainActivity activity = (MainActivity) getActivity();
             LocalStorage.getInstance().cleanSession(activity, false);
-            NavHostFragment.findNavController(TakeSuccessFragment.this)
-                    .navigate(R.id.action_takeSuccessFragment_to_mainFragment);
+            NavUtils.navigate(this, R.id.action_takeSuccessFragment_to_mainFragment);
         });
 
         try {

+ 2 - 2
app/src/main/java/com/emato/ich/utils/BaseUtils.java

@@ -118,8 +118,8 @@ public class BaseUtils {
     }
 
     public static String getClientId() {
-        return StringUtils.isNullOrEmpty(MAC) ? Md5Utils.string2Md5_16(getMac()).toUpperCase() : Md5Utils.string2Md5_16(MAC).toUpperCase();
-//        return "285F18D92D0B6568";// 8F00B204E9800998
+//        return StringUtils.isNullOrEmpty(MAC) ? Md5Utils.string2Md5_16(getMac()).toUpperCase() : Md5Utils.string2Md5_16(MAC).toUpperCase();
+        return "222222222";// 8F00B204E9800998
     }
 
     public static String getMac2() {

+ 57 - 0
app/src/main/java/com/emato/ich/utils/NavUtils.java

@@ -0,0 +1,57 @@
+package com.emato.ich.utils;
+
+import android.os.Bundle;
+
+import androidx.fragment.app.Fragment;
+import androidx.navigation.NavBackStackEntry;
+import androidx.navigation.NavController;
+import androidx.navigation.fragment.NavHostFragment;
+
+import com.emato.ich.MainActivity;
+import com.emato.ich.fragment.SendInfoConfirmFragment;
+import com.emato.ich.local.LocalStorage;
+
+
+/**
+ * 导航工具类
+ */
+public class NavUtils {
+
+    private static final String TAG = NavUtils.class.getName();
+
+    /**
+     * 跳转
+     * @param fragment  Fragment
+     * @param navId     action_id
+     * @param bundle    参数
+     * @param flag      清空session场景
+     */
+    public static void navigate(Fragment fragment, int navId, Bundle bundle, boolean flag) {
+        try {
+            NavController navController = NavHostFragment.findNavController(fragment);
+            NavBackStackEntry currentBackStackEntry = navController.getCurrentBackStackEntry();
+            if (currentBackStackEntry != null) {
+                if (currentBackStackEntry.getDestination().getAction(navId) != null) {
+                    navController.navigate(navId, bundle);
+                    // 清空session和页面传值, 异常处理有不同处理方式
+                    LocalStorage.getInstance().cleanSession((MainActivity) fragment.getActivity(), flag);
+                }
+            }
+        } catch (Exception e) {
+            Log.e(TAG, "跳转出现异常! ", e);
+        }
+    }
+
+    public static void navigate(Fragment fragment, int navId, Bundle bundle) {
+        navigate(fragment, navId, bundle, false);
+    }
+
+    public static void navigate(Fragment fragment, int navId, boolean flag) {
+        navigate(fragment, navId, null, flag);
+    }
+
+    public static void navigate(Fragment fragment, int navId) {
+        navigate(fragment, navId, null, false);
+    }
+
+}

+ 4 - 5
app/src/main/java/com/emato/ich/utils/TimeOutUtils.java

@@ -45,14 +45,13 @@ public class TimeOutUtils {
             public void onFinish() {
                 int fragmentAction = getFragmentAction(fragment);
                 if (fragmentAction != 0) {
-                    NavHostFragment.findNavController(fragment).navigate(fragmentAction);
-                    // 清空session和页面传值, 异常处理有不同处理方式
-                    boolean isException = false;
+                    // 异常处理的清空session
                     if ( LocalStorage.getInstance().getSession().getException() &&
                          (fragment instanceof SendInfoConfirmFragment)) {
-                        isException = true;
+                        NavUtils.navigate(fragment, fragmentAction, true);
+                    } else {
+                        NavUtils.navigate(fragment, fragmentAction);
                     }
-                    LocalStorage.getInstance().cleanSession(mainActivity, isException);
                     fragment.onDestroy();
                 }
             }