File tree 2 files changed +15
-6
lines changed
utilcode/src/main/java/com/blankj/utilcode/utils
2 files changed +15
-6
lines changed Original file line number Diff line number Diff line change 1
1
###
2
+ #### 16/11/15 完善正则工具类
2
3
#### 16/11/14 新增启动服务
3
4
#### 16/11/13 新增判断sim卡是否准备好
4
5
#### 16/11/12 最近一直在博客搬家,所以更得有点少,新增重启到recovery和bootloader,新增获取launcher activity
Original file line number Diff line number Diff line change 25
25
*/
26
26
public class CrashUtils implements Thread .UncaughtExceptionHandler {
27
27
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 ;
34
35
35
36
private CrashUtils () {
36
37
}
@@ -42,6 +43,13 @@ private CrashUtils() {
42
43
* @return 单例
43
44
*/
44
45
public static CrashUtils getInstance () {
46
+ if (mInstance == null ) {
47
+ synchronized (CrashUtils .class ) {
48
+ if (mInstance == null ) {
49
+ mInstance = new CrashUtils ();
50
+ }
51
+ }
52
+ }
45
53
return mInstance ;
46
54
}
47
55
You can’t perform that action at this time.
0 commit comments