misc fixes
* add null checks before resuming a download * (MissionAdapter.java) reset percent after resuming a download. prevents the "Error" string get stuck, until the download start
This commit is contained in:
parent
df4dd0122f
commit
c4a5e8dc86
|
@ -407,6 +407,7 @@ public class DownloadMission extends Mission {
|
||||||
|
|
||||||
// ensure that the previous state is completely paused.
|
// ensure that the previous state is completely paused.
|
||||||
joinForThread(init);
|
joinForThread(init);
|
||||||
|
if (threads != null)
|
||||||
for (Thread thread : threads) joinForThread(thread);
|
for (Thread thread : threads) joinForThread(thread);
|
||||||
|
|
||||||
enqueued = false;
|
enqueued = false;
|
||||||
|
@ -420,7 +421,7 @@ public class DownloadMission extends Mission {
|
||||||
|
|
||||||
init = null;
|
init = null;
|
||||||
|
|
||||||
if (threads.length < 1) {
|
if (threads == null || threads.length < 1) {
|
||||||
threads = new Thread[currentThreadCount];
|
threads = new Thread[currentThreadCount];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -447,6 +447,7 @@ public class MissionAdapter extends Adapter<ViewHolder> {
|
||||||
if (mission != null) {
|
if (mission != null) {
|
||||||
switch (id) {
|
switch (id) {
|
||||||
case R.id.start:
|
case R.id.start:
|
||||||
|
h.status.setText(UNDEFINED_SPEED);
|
||||||
h.state = -1;
|
h.state = -1;
|
||||||
h.size.setText(Utility.formatBytes(mission.getLength()));
|
h.size.setText(Utility.formatBytes(mission.getLength()));
|
||||||
mDownloadManager.resumeMission(mission);
|
mDownloadManager.resumeMission(mission);
|
||||||
|
|
Loading…
Reference in New Issue