File tree Expand file tree Collapse file tree
utilcode/src/main/java/com/blankj/utilcode/utils Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11###
2+ #### 16/11/15 完善正则工具类
23#### 16/11/14 新增启动服务
34#### 16/11/13 新增判断sim卡是否准备好
45#### 16/11/12 最近一直在博客搬家,所以更得有点少,新增重启到recovery和bootloader,新增获取launcher activity
Original file line number Diff line number Diff line change 2525 */
2626public class CrashUtils implements Thread .UncaughtExceptionHandler {
2727
28- private static CrashUtils mInstance = new CrashUtils ();
29- private UncaughtExceptionHandler mHandler ;
30- private boolean mInitialized ;
31- private static String crashDir ;
32- private String versionName ;
33- private int versionCode ;
28+ private volatile static CrashUtils mInstance ;
29+
30+ private UncaughtExceptionHandler mHandler ;
31+ private boolean mInitialized ;
32+ private String crashDir ;
33+ private String versionName ;
34+ private int versionCode ;
3435
3536 private CrashUtils () {
3637 }
@@ -42,6 +43,13 @@ private CrashUtils() {
4243 * @return 单例
4344 */
4445 public static CrashUtils getInstance () {
46+ if (mInstance == null ) {
47+ synchronized (CrashUtils .class ) {
48+ if (mInstance == null ) {
49+ mInstance = new CrashUtils ();
50+ }
51+ }
52+ }
4553 return mInstance ;
4654 }
4755
You can’t perform that action at this time.
0 commit comments