Created
August 8, 2013 08:38
-
-
Save benlieb/6182784 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (!download_data.getBoolean("currently_downloading", false)) | |
{ | |
//find the first one whose percent is 0 and start it. | |
Map<String, ?> items = download_data.getAll(); | |
for(Map.Entry<String,?> entry : items.entrySet()){ | |
if (entry.getValue() instanceof Integer) { //this is a cheap way to test if the key/value pair is 'about' a download. All other values, e.g. 'currently_downloading' are not Integers. This may change. | |
if (entry.getValue() == 0) | |
{ | |
Integer position = Integer.parseInt(entry.getKey()); | |
Download d = new Download(); | |
d.start(position); | |
return; | |
} | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment