黑屏,而Android的活动之间移 [英] Blank black screen while shifting between activities android

查看:149
本文介绍了黑屏,而Android的活动之间移的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好我有2个活动,1是Android原生(扩展活动)和2是LIBGdx扩展AndroidApplication。

Hi Guys I have 2 activities, 1 is in Android Native(Extends Activity) and 2 is in LIBGdx extends AndroidApplication.

我从活动1到2的活动,然后由pressing返回键回到活动1,然后我再来活动2一次。这次活动2是黑色和黑色。

I go from activity 1 to activity 2 and then come back to activity 1 by pressing the back key, then I come back to activity 2 again. This time activity 2 is black and black in color.

请问有什么关系libgdx或它的机器人问题?

Does it has anything to do with libgdx or its an android issue?

感谢

推荐答案

这听起来像libGdx失去OpenGL上下文。当应用程序超出对焦(呼入电话,用户presses home键等)libgdx将自动获得这一回,然后回来成为关注的焦点,但这里的应用从未失去焦点 - 只有活动does--所以libgdx不知道自己恢复。

This sounds like libGdx is losing the openGL context. libgdx will get this back automatically when the app goes out of focus (incoming phone call, user presses home key, etc) and then comes back into focus, but here the app never loses focus--only the activity does--so libgdx doesn't know to restore itself.

用户是否需要回到第一个画面?如果没有,我将标志着第一个活动的android:noHistory =真正的在清单。这使得后退按钮跳过活性,使应用程序本身会失去焦点。

Does the user need to go back to the first screen? If not, I would mark the first activity android:noHistory="true" in the manifest. That makes the back button skip the activity, so the app itself will lose focus.

否则,您ApplicationListener的创建()简历()暂停()和的Dispose()方法,所以我们可以看到,生命周期是如何打出来。

Otherwise, put debug statements in your ApplicationListener's create(), resume(), pause(), and dispose() methods so we can see how that life cycle is playing out.

这篇关于黑屏,而Android的活动之间移的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆