Pārlūkot izejas kodu

优化app异常启动

weizhengliang 3 gadi atpakaļ
vecāks
revīzija
ec3951e736

+ 4 - 6
callingbed/src/main/java/com/wdkl/app/ncs/callingbed/helper/XCrashUtils.java

@@ -69,10 +69,8 @@ public class XCrashUtils {
             if (!BuildConfig.DEBUG) {
                 uploadCrashLog(logPath);
             } else {
-                AppUtils.relaunchApp(true);
+                restartApp();
             }
-
-            //restartApp();
         }
     };
 
@@ -139,7 +137,7 @@ public class XCrashUtils {
                 @Override
                 public void onFail() {
                     Log.e(TAG,"错误日志文件上传失败!");
-                    AppUtils.relaunchApp(true);
+                    restartApp();
                 }
 
                 @Override
@@ -180,7 +178,7 @@ public class XCrashUtils {
                 @Override
                 public void onFailure(Call call, IOException e) {
                     Log.e(TAG,"错误日志名称上传失败"+e.getMessage());
-                    AppUtils.relaunchApp(true);
+                    restartApp();
                 }
 
                 @Override
@@ -189,7 +187,7 @@ public class XCrashUtils {
                     TombstoneManager.deleteTombstone(logPath);
                     //String data = response.body().string();
                     //Log.d(TAG,"错误日志数据 data "+data);
-                    AppUtils.relaunchApp(true);
+                    restartApp();
                 }
             });
         } catch (Exception e) {