AndEngine:如何删除启动默认活动屏幕

时间:2013-09-10 20:45:06

标签: java android android-activity andengine

我试图使用AndEngine制作示例游戏,使用简单的代码:

public class MainActivity extends SimpleBaseGameActivity {

    static final int CAMERA_WIDTH = 800;
    static final int CAMERA_HEIGHT = 480;

    @Override
    public EngineOptions onCreateEngineOptions() {
        Camera camera = new Camera(0, 0, CAMERA_WIDTH, CAMERA_HEIGHT);
        return new EngineOptions(true, ScreenOrientation.LANDSCAPE_SENSOR, new RatioResolutionPolicy(CAMERA_WIDTH, CAMERA_HEIGHT), camera);
    }

    @Override
    protected void onCreateResources() {
        //TODO
    }

    @Override
    protected Scene onCreateScene() {
        Scene scene = new Scene();
        scene.setBackground(new Background(0.09804f, 0.6274f, 0));
        return scene;
    }
}

但是我发现了一个奇怪的行为:当应用程序启动时,它会在第一时间显示默认的android活动屏幕,标题栏和深色背景,只是片刻,然后以绿色背景启动我的活动,因为它必须是。我怎样才能删除这个启动的东西?

2 个答案:

答案 0 :(得分:1)

查看您的AndroidManifest.xml文件。

在申请中: 删除android:theme =“@ style / AppTheme”

活动中: 添加android:screenOrientation =“landscape” 或者添加android:screenOrientation =“portrait”

答案 1 :(得分:0)

我的问题是我有

screenOrientation = landscape | sensor,

成功了:

screenOrientation = landscape,

,默认的应用程序屏幕消失了。