package au.com.codeka.warworlds.game.starfield;

import java.io.IOException;

import org.andengine.entity.scene.Scene;

import android.annotation.SuppressLint;
import android.os.Bundle;
import android.view.Window;
import au.com.codeka.warworlds.BaseGlActivity;
import au.com.codeka.warworlds.R;
import au.com.codeka.warworlds.model.EmpireShieldManager;

/** This is the base activity for activities that show a starfield. */
@SuppressLint("Registered") // it's a base class
public abstract class BaseStarfieldActivity extends BaseGlActivity {
    protected StarfieldSceneManager mStarfield;

    @Override
    public void onCreate(final Bundle savedInstanceState) {
        requestWindowFeature(Window.FEATURE_NO_TITLE);
        super.onCreate(savedInstanceState);

        EmpireShieldManager.i.clearTextureCache();

        mStarfield = new StarfieldSceneManager(this);
    }

    @Override
    protected int getRenderSurfaceViewID() {
        return R.id.starfield;
    }

    @Override
    protected void onCreateResources() throws IOException {
        mStarfield.onLoadResources();
    }

    @Override
    protected Scene onCreateScene() throws IOException {
        return mStarfield.createScene();
    }

    @Override
    public void onStart() {
        super.onStart();
        mStarfield.onStart();
    }

    @Override
    public void onStop() {
        super.onStop();
        mStarfield.onStop();
    }
}

@@ -763,60 +763,8 @@
 );%0A%0A
-        EmpireShieldManager.i.clearTextureCache();%0A%0A
     
@@ -1251,32 +1251,160 @@
 Start();%0A    %7D%0A%0A
+    @Override%0A    public void onResume() %7B%0A        super.onResume(); %0A        EmpireShieldManager.i.clearTextureCache();%0A    %7D%0A%0A
     @Override%0A  

Clear the texture cache in onResume, not onCreate().