File tree Expand file tree Collapse file tree 1 file changed +13
-15
lines changed
app/src/main/java/com/blankj/androidutilcode/helper Expand file tree Collapse file tree 1 file changed +13
-15
lines changed Original file line number Diff line number Diff line change 1
1
package com .blankj .androidutilcode .helper ;
2
2
3
3
import com .blankj .androidutilcode .Config ;
4
- import com .blankj .subutil .util .ThreadPoolUtils ;
5
4
import com .blankj .utilcode .util .FileIOUtils ;
6
5
import com .blankj .utilcode .util .FileUtils ;
7
6
import com .blankj .utilcode .util .LogUtils ;
7
+ import com .blankj .utilcode .util .ThreadUtils ;
8
8
import com .blankj .utilcode .util .Utils ;
9
9
10
- import java .io .IOException ;
11
-
12
10
/**
13
11
* <pre>
14
12
* author: Blankj
@@ -21,19 +19,19 @@ public class AssertHelper {
21
19
22
20
public static void releaseInstallApk (final OnReleasedListener listener ) {
23
21
if (!FileUtils .isFileExists (Config .TEST_APK_PATH )) {
24
- ThreadPoolUtils poolUtils = new ThreadPoolUtils (ThreadPoolUtils .SingleThread , 1 );
25
- poolUtils .execute (new Runnable () {
22
+ ThreadUtils .executeByIo (new ThreadUtils .SimpleTask <Void >() {
26
23
@ Override
27
- public void run () {
28
- try {
29
- FileIOUtils .writeFileFromIS (
30
- Config .TEST_APK_PATH ,
31
- Utils .getApp ().getAssets ().open ("test_install" ),
32
- false
33
- );
34
- } catch (IOException e ) {
35
- e .printStackTrace ();
36
- }
24
+ public Void doInBackground () throws Throwable {
25
+ FileIOUtils .writeFileFromIS (
26
+ Config .TEST_APK_PATH ,
27
+ Utils .getApp ().getAssets ().open ("test_install" ),
28
+ false
29
+ );
30
+ return null ;
31
+ }
32
+
33
+ @ Override
34
+ public void onSuccess (Void result ) {
37
35
if (listener != null ) {
38
36
listener .onReleased ();
39
37
}
You can’t perform that action at this time.
0 commit comments