Close the application if downloads failed, when user presses Back key

This commit is contained in:
pelya
2010-09-20 15:26:48 +03:00
parent 37df37fc4b
commit 164464257c
3 changed files with 11 additions and 2 deletions

View File

@@ -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;
}