【问题标题】:How to enable screen timeout in AndEngine?如何在 AndEngine 中启用屏幕超时?
【发布时间】:2014-11-26 21:20:54
【问题描述】:

我刚刚开始使用 AndEngine 创建一个 android 游戏,从外观上看,Game Activity 会默认保持屏幕开启。我正在开发的游戏需要玩家持续关注,因此当长时间没有注册触摸输入时,无需保持屏幕开启。那么如何开启屏幕超时呢?

我的猜测是使用 setWakeLockOption,但我无法弄清楚要传递给函数的内容。

【问题讨论】:

    标签: android timeout screen andengine


    【解决方案1】:

    我不得不删除 BaseGameActivitys onResume 方法中的 acquireWakeLock 调用

    protected synchronized void onResume() {
            if (BuildConfig.DEBUG) {
                Debug.d(this.getClass().getSimpleName() + ".onResume" + " @(Thread: '" + Thread.currentThread().getName() + "')");
            }
    
            super.onResume();
    
            //this.acquireWakeLock();
            this.mRenderSurfaceView.onResume();
        }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-06-02
      • 1970-01-01
      • 2021-04-01
      • 2022-01-25
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多