提交 92fdf3a3 编写于 作者: B Blankj

see 05/22 log

上级 1aa6ee37
package com.blankj.androidutilcode.helper; package com.blankj.androidutilcode.helper;
import com.blankj.androidutilcode.Config; import com.blankj.androidutilcode.Config;
import com.blankj.subutil.util.ThreadPoolUtils;
import com.blankj.utilcode.util.FileIOUtils; import com.blankj.utilcode.util.FileIOUtils;
import com.blankj.utilcode.util.FileUtils; import com.blankj.utilcode.util.FileUtils;
import com.blankj.utilcode.util.LogUtils; import com.blankj.utilcode.util.LogUtils;
import com.blankj.utilcode.util.ThreadUtils;
import com.blankj.utilcode.util.Utils; import com.blankj.utilcode.util.Utils;
import java.io.IOException;
/** /**
* <pre> * <pre>
* author: Blankj * author: Blankj
...@@ -21,19 +19,19 @@ public class AssertHelper { ...@@ -21,19 +19,19 @@ public class AssertHelper {
public static void releaseInstallApk(final OnReleasedListener listener) { public static void releaseInstallApk(final OnReleasedListener listener) {
if (!FileUtils.isFileExists(Config.TEST_APK_PATH)) { if (!FileUtils.isFileExists(Config.TEST_APK_PATH)) {
ThreadPoolUtils poolUtils = new ThreadPoolUtils(ThreadPoolUtils.SingleThread, 1); ThreadUtils.executeByIo(new ThreadUtils.SimpleTask<Void>() {
poolUtils.execute(new Runnable() {
@Override @Override
public void run() { public Void doInBackground() throws Throwable {
try {
FileIOUtils.writeFileFromIS( FileIOUtils.writeFileFromIS(
Config.TEST_APK_PATH, Config.TEST_APK_PATH,
Utils.getApp().getAssets().open("test_install"), Utils.getApp().getAssets().open("test_install"),
false false
); );
} catch (IOException e) { return null;
e.printStackTrace();
} }
@Override
public void onSuccess(Void result) {
if (listener != null) { if (listener != null) {
listener.onReleased(); listener.onReleased();
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册