Improved the Android downloader, now it's a lot faster because all the image urls have been indexed.

This commit is contained in:
valfieri
2019-08-31 01:23:36 +02:00
parent 818233213e
commit 2fe9924fe5
2 changed files with 235 additions and 28 deletions

View File

@@ -365,6 +365,7 @@ public class SDLActivity extends Activity implements OnKeyListener {
boolean[] checkedSet;
Integer totalset = 0;
boolean finished = false;
boolean finished2 = false;
boolean loadResInProgress = false;
ProgressDialog progressBarDialogRes;
@@ -421,7 +422,7 @@ public class SDLActivity extends Activity implements OnKeyListener {
progressBarDialogRes.dismiss();
mHandler.post(new Runnable() {
public void run() {
while (!finished) {
while (!finished || !finished2) {
try {
Thread.sleep(5000);
} catch (Exception e) {
@@ -434,6 +435,13 @@ public class SDLActivity extends Activity implements OnKeyListener {
}
}).start();
new Thread(new Runnable() {
public void run() {
ImgDownloader.loadDatabase(getSystemStorageLocation());
finished2 = true;
}
}).start();
progressBarDialogRes.show();