Fixed data downloader not downloading optional packages

This commit is contained in:
pelya
2010-08-27 15:42:44 +03:00
parent 1330aec692
commit 6bd7d4126f
14 changed files with 233 additions and 230 deletions

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.googlecode.opentyrian;
package com.sourceforge.sc2;
import android.app.Activity;
import android.content.Context;
@@ -26,9 +26,12 @@ public class MainActivity extends Activity {
_tv = new TextView(this);
_tv.setText("Initializing");
setContentView(_tv);
mLoadLibraryStub = new LoadLibrary();
mAudioThread = new AudioThread(this);
Settings.Load(this);
if(mAudioThread == null) // Starting from background (should not happen)
{
mLoadLibraryStub = new LoadLibrary();
mAudioThread = new AudioThread(this);
Settings.Load(this);
}
}
public void startDownloader()
@@ -57,7 +60,7 @@ public class MainActivity extends Activity {
protected void onPause() {
if( downloader != null ) {
synchronized( downloader ) {
downloader.setParent(null, null);
downloader.setParent(null, null);
}
}
// TODO: if application pauses it's screen is messed up
@@ -75,6 +78,7 @@ public class MainActivity extends Activity {
super.onResume();
if( mGLView != null )
mGLView.onResume();
else
if( downloader != null ) {
synchronized( downloader ) {
downloader.setParent(this, _tv);
@@ -89,7 +93,7 @@ public class MainActivity extends Activity {
{
if( downloader != null ) {
synchronized( downloader ) {
downloader.setParent(null, null);
downloader.setParent(null, null);
}
}
if( wakeLock != null )
@@ -154,8 +158,8 @@ public class MainActivity extends Activity {
}
private DemoGLSurfaceView mGLView = null;
private LoadLibrary mLoadLibraryStub = null;
private AudioThread mAudioThread = null;
private static LoadLibrary mLoadLibraryStub = null;
private static AudioThread mAudioThread = null;
private PowerManager.WakeLock wakeLock = null;
private static DataDownloader downloader = null;
private TextView _tv = null;