1.下载文件报错异常可以先建立临时空文件方便下次任务驱动下载
2.启动第三方应用需要建立新栈
This commit is contained in:
@@ -130,6 +130,14 @@ public class DownLoadTaskThread implements Runnable {
|
||||
e.printStackTrace();
|
||||
LogUtils.loge("download Exception===>"+e.getMessage());
|
||||
// TODO: 2025/12/17 异常检验-tmp是否存在,不存在再建一个0KB临时空文件可保证 文件以后一定能下载下来
|
||||
File file = new File(bean.getPath(), bean.getFileName()+"-tmp");
|
||||
if(!file.exists()){
|
||||
try {
|
||||
file.createNewFile();
|
||||
} catch (IOException ex) {
|
||||
LogUtils.loge("exception happen before file create,must create tmp file");
|
||||
}
|
||||
}
|
||||
if (observer != null) {
|
||||
observer.onError(bean, bean.getTaskId(), e.getMessage());
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ public class IntentUtil {
|
||||
intent = context.getPackageManager().getLeanbackLaunchIntentForPackage(packageName);
|
||||
}
|
||||
if(intent!=null){
|
||||
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
|
||||
context.startActivity(intent);
|
||||
}else {
|
||||
Toast.makeText( context, tipmsg, Toast.LENGTH_SHORT).show();
|
||||
|
||||
Reference in New Issue
Block a user