File tree Expand file tree Collapse file tree
app/src/main/java/com/blankj/androidutilcode/helper Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11package com .blankj .androidutilcode .helper ;
22
33import com .blankj .androidutilcode .Config ;
4- import com .blankj .subutil .util .ThreadPoolUtils ;
54import com .blankj .utilcode .util .FileIOUtils ;
65import com .blankj .utilcode .util .FileUtils ;
76import com .blankj .utilcode .util .LogUtils ;
7+ import com .blankj .utilcode .util .ThreadUtils ;
88import com .blankj .utilcode .util .Utils ;
99
10- import java .io .IOException ;
11-
1210/**
1311 * <pre>
1412 * author: Blankj
@@ -21,19 +19,19 @@ public class AssertHelper {
2119
2220 public static void releaseInstallApk (final OnReleasedListener listener ) {
2321 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 >() {
2623 @ 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 ) {
3735 if (listener != null ) {
3836 listener .onReleased ();
3937 }
You can’t perform that action at this time.
0 commit comments