File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed
app/src/main/java/com/blankj/androidutilcode Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change 1
1
package com .blankj .androidutilcode ;
2
2
3
3
import com .blankj .androidutilcode .base .BaseApplication ;
4
+ import com .blankj .subutil .util .ThreadPoolUtils ;
4
5
import com .blankj .utilcode .util .CrashUtils ;
5
6
import com .blankj .utilcode .util .FileIOUtils ;
6
7
import com .blankj .utilcode .util .FileUtils ;
@@ -47,6 +48,7 @@ private void initLeakCanary() {
47
48
LeakCanary .install (this );
48
49
}
49
50
51
+ // init it in ur application
50
52
public void initLog () {
51
53
LogUtils .Config config = LogUtils .getConfig ()
52
54
.setLogSwitch (BuildConfig .DEBUG )// 设置log总开关,包括输出到控制台和文件,默认开
@@ -69,11 +71,17 @@ private void initCrash() {
69
71
70
72
private void initAssets () {
71
73
if (!FileUtils .isFileExists (com .blankj .androidutilcode .Config .getTestApkPath ())) {
72
- try {
73
- FileIOUtils .writeFileFromIS (com .blankj .androidutilcode .Config .getTestApkPath (), getAssets ().open ("test_install" ), false );
74
- } catch (IOException e ) {
75
- e .printStackTrace ();
76
- }
74
+ ThreadPoolUtils poolUtils = new ThreadPoolUtils (ThreadPoolUtils .SingleThread , 1 );
75
+ poolUtils .execute (new Runnable () {
76
+ @ Override
77
+ public void run () {
78
+ try {
79
+ FileIOUtils .writeFileFromIS (Config .getTestApkPath (), getAssets ().open ("test_install" ), false );
80
+ } catch (IOException e ) {
81
+ e .printStackTrace ();
82
+ }
83
+ }
84
+ });
77
85
}
78
86
}
79
87
}
You can’t perform that action at this time.
0 commit comments