Close the application if downloads failed, when user presses Back key
This commit is contained in:
@@ -155,7 +155,10 @@ class DataDownloader extends Thread
|
||||
{
|
||||
if( downloadFiles[i].length() > 0 && Globals.OptionalDataDownload.length > i && Globals.OptionalDataDownload[i] )
|
||||
if( ! DownloadDataFile(downloadFiles[i], "libsdl-DownloadFinished-" + String.valueOf(i) + ".flag") )
|
||||
{
|
||||
DownloadFailed = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
DownloadComplete = true;
|
||||
initParent();
|
||||
@@ -446,6 +449,7 @@ class DataDownloader extends Thread
|
||||
|
||||
public StatusWriter Status;
|
||||
public boolean DownloadComplete = false;
|
||||
public boolean DownloadFailed = false;
|
||||
private MainActivity Parent;
|
||||
private String outFilesDir = null;
|
||||
}
|
||||
|
||||
@@ -100,8 +100,13 @@ public class MainActivity extends Activity {
|
||||
if( mGLView != null )
|
||||
mGLView.nativeKey( keyCode, 1 );
|
||||
else
|
||||
if( keyCode == KeyEvent.KEYCODE_BACK && downloader != null && !downloader.DownloadComplete )
|
||||
if( keyCode == KeyEvent.KEYCODE_BACK && downloader != null )
|
||||
{
|
||||
if( downloader.DownloadFailed )
|
||||
System.exit(1);
|
||||
if( !downloader.DownloadComplete )
|
||||
onStop();
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -111,7 +111,7 @@ class Settings
|
||||
public void run()
|
||||
{
|
||||
try {
|
||||
Thread.sleep(1500);
|
||||
Thread.sleep(2000);
|
||||
} catch( InterruptedException e ) {};
|
||||
if( changeConfigAlert == null )
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user