有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java Android应用程序只能在一台设备上冻结,而且有时也会冻结。(带输出)

所以,我有一个安卓游戏,可以在画布上画东西。所以基本上,它一直在循环:

onDraw(Canvas c){
    doThis();
    doThat();
    drawThis(c);
    drawThat(c);
    invalidate(); //calls onDraw again
}

除三星Galaxy S6 Edge外,它在任何设备上都能完美流畅地工作。我自己也有一个,我的一个朋友也经历了同样的事情。(问题很可能也发生在普通的S6上,因为它包含几乎相同的硬件,但我从未在该设备上运行过该应用程序)

问题是:应用程序最初运行平稳,但在运行几分钟后,它会永远冻结(或者至少20分钟,然后我放弃),直到TouchWiz要求停止任务。 因此,UI没有响应,只是冻结了,没有其他事情发生,但我现在能够在设备上捕捉到控制台输出:

W/Resources: Converting to string: TypedValue{t=0x12/d=0x0 a=3 r=0x7f0d003c}
W/Resources: Converting to string: TypedValue{t=0x12/d=0x0 a=3 r=0x7f0d003d}
D/Activity: performCreate Call Injection manager
I/InjectionManager: dispatchOnViewCreated > Target : com.dj.gravitydodge.FullscreenActivity isFragment :false
D/OpenGLRenderer: Use EGL_SWAP_BEHAVIOR_PRESERVED: true
D/PhoneWindow: *FMB* isFloatingMenuEnabled mFloatingMenuBtn : null
D/PhoneWindow: *FMB* isFloatingMenuEnabled return false
D/SRIB_DCS: log_dcs ThreadedRenderer::initialize entered! 
D/libEGL: loaded /vendor/lib64/egl/libGLES_mali.so
I/OpenGLRenderer: Initialized EGL, version 1.4
I/OpenGLRenderer: HWUI protection enabled for context ,  &this =0x7f7ef05e60 ,&mEglDisplay = 1 , &mEglConfig = 2130264752
D/OpenGLRenderer: Get maximum texture size. GL_MAX_TEXTURE_SIZE is 8192
D/OpenGLRenderer: Enabling debug mode 0
D/mali_winsys: new_window_surface returns 0x3000,  [2560x1440]-format:1
I/Timeline: Timeline: Activity_idle id: 安卓.os.BinderProxy@33c468cf time:304260522
D/ViewRootImpl: ViewPostImeInputStage ACTION_DOWN
[... No output for a while ...]
I/art: Background sticky concurrent mark sweep GC freed 227691(7MB) AllocSpace objects, 0(0B) LOS objects, 10% free, 58MB/65MB, paused 622us total 113.736ms
[Freeze]

设备规格:

CPU: Samsung Exynos 7420 (4x1,5GHz & 4x2,1GHz) [Btw the only Octacore CPU, the app was tested on]
GPU: Mali-T760
RAM: 3GB DDR4
[More info: http://www.gsmarena.com/samsung_galaxy_s6-6849.php]

如果你知道问题的原因是什么,或者我如何解决它,请回答。 提前感谢:)


共 (0) 个答案