Tiny fix to data downloader

This commit is contained in:
pelya
2012-09-18 10:06:44 +03:00
parent 7247509c04
commit 6d059c046a
3 changed files with 18 additions and 4 deletions

View File

@@ -292,8 +292,22 @@ class DataDownloader extends Thread
Status.setText( downloadCount + "/" + downloadTotal + ": " + res.getString(R.string.connecting_to, url) );
if( url.indexOf("http://") == -1 && url.indexOf("https://") == -1 ) // File inside assets
{
System.out.println("Fetching file from assets: " + url);
InputStream stream1 = null;
try {
stream1 = Parent.getAssets().open(url);
stream1.close();
} catch( Exception e ) {
try {
stream1 = Parent.getAssets().open(url + "00");
stream1.close();
} catch( Exception ee ) {
System.out.println("Failed to open file in assets: " + url);
downloadUrlIndex++;
continue;
}
}
FileInAssets = true;
System.out.println("Fetching file from assets: " + url);
break;
}
else