GLSurfaceView 中的方向更改问题
我正在使用 Android openGLES1.0 旋转多边形。如果我连续更改设备的方向(从横向到纵向,反之亦然)2.3 次,我的活动 GLSurfaceView 就会消失。它会导致之前的活动(屏幕)。logcat 显示以下消息。 请帮我。
这是我的日志:
09-08 19:39:29.865: INFO/DEBUG(28): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-08 19:39:29.865: INFO/DEBUG(28): Build fingerprint: 'generic/sdk/generic/:2.1-update1/ECLAIR/35983:eng/test-keys'
09-08 19:39:29.865: INFO/DEBUG(28): pid: 860, tid: 878 >>> com.samples.android.MyExample <<<
09-08 19:39:29.865: INFO/DEBUG(28): signal 11 (SIGSEGV), fault addr 46aff000
09-08 19:39:29.865: INFO/DEBUG(28): r0 46aff000 r1 ffffffff r2 00000268 r3 ffffffff
09-08 19:39:29.865: INFO/DEBUG(28): r4 00000120 r5 46afeec8 r6 000003c0 r7 00000640
09-08 19:39:29.865: INFO/DEBUG(28): r8 475fad88 r9 42f26ee4 10 42f26ecc fp 0011dcf0
09-08 19:39:29.865: INFO/DEBUG(28): ip ffffffff sp 475fad1c lr ffffffff pc afb043f4 cpsr 20000010
09-08 19:39:30.005: INFO/DEBUG(28): #00 pc 000043f4 /system/lib/libcutils.so
09-08 19:39:30.025: INFO/DEBUG(28): #01 pc 00015284 /system/lib/libpixelflinger.so
09-08 19:39:30.025: INFO/DEBUG(28): #02 pc 000153cc /system/lib/libpixelflinger.so
09-08 19:39:30.025: INFO/DEBUG(28): #03 pc 00014b84 /system/lib/egl/libGLES_android.so
09-08 19:39:30.025: INFO/DEBUG(28): #04 pc 0000f1f4 /system/lib/libdvm.so
09-08 19:39:30.025: INFO/DEBUG(28): #05 pc 00037fcc /system/lib/libdvm.so
09-08 19:39:30.035: INFO/DEBUG(28): #06 pc 00031642 /system/lib/libdvm.so
09-08 19:39:30.035: INFO/DEBUG(28): #07 pc 00013f58 /system/lib/libdvm.so
09-08 19:39:30.035: INFO/DEBUG(28): #08 pc 00019888 /system/lib/libdvm.so
09-08 19:39:30.035: INFO/DEBUG(28): #09 pc 00018d5c /system/lib/libdvm.so
09-08 19:39:30.045: INFO/DEBUG(28): #10 pc 0004d6d0 /system/lib/libdvm.so
09-08 19:39:30.045: INFO/DEBUG(28): #11 pc 0004d702 /system/lib/libdvm.so
09-08 19:39:30.055: INFO/DEBUG(28): #12 pc 00041c78 /system/lib/libdvm.so
09-08 19:39:30.055: INFO/DEBUG(28): #13 pc 00010000 /system/lib/libc.so
09-08 19:39:30.055: INFO/DEBUG(28): #14 pc 0000fad4 /system/lib/libc.so
09-08 19:39:30.055: INFO/DEBUG(28): code around pc:
09-08 19:39:30.055: INFO/DEBUG(28): afb043e4 e1b03103 24801004 e1a03001 e2522020
09-08 19:39:30.065: INFO/DEBUG(28): afb043f4 28a0500a 28a0500a 2afffffb e2822020
09-08 19:39:30.065: INFO/DEBUG(28): afb04404 e1b02e02 28a0500a 48a04002 e1b02102
09-08 19:39:30.065: INFO/DEBUG(28): code around lr:
09-08 19:39:30.065: INFO/DEBUG(28): stack:
09-08 19:39:30.065: INFO/DEBUG(28): 475facdc 00000000
09-08 19:39:30.065: INFO/DEBUG(28): 475face0 bf8295fb
09-08 19:39:30.065: INFO/DEBUG(28): 475face4 bf800000
09-08 19:39:30.065: INFO/DEBUG(28): 475face8 00000000
09-08 19:39:30.065: INFO/DEBUG(28): 475facec 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475facf0 c0014afd
09-08 19:39:30.075: INFO/DEBUG(28): 475facf4 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475facf8 40c19648
09-08 19:39:30.075: INFO/DEBUG(28): 475facfc 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475fad00 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475fad04 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475fad08 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475fad0c 40805851
09-08 19:39:30.075: INFO/DEBUG(28): 475fad10 df002777
09-08 19:39:30.075: INFO/DEBUG(28): 475fad14 e3a070ad
09-08 19:39:30.075: INFO/DEBUG(28): 475fad18 00000000
09-08 19:39:30.075: INFO/DEBUG(28): #00 475fad1c acf15287 /system/lib/libpixelflinger.so
09-08 19:39:30.075: INFO/DEBUG(28): #01 475fad20 bf8295fb
09-08 19:39:30.085: INFO/DEBUG(28): 475fad24 0000ffff [heap]
09-08 19:39:30.085: INFO/DEBUG(28): 475fad28 00000000
09-08 19:39:30.085: INFO/DEBUG(28): 475fad2c 003e8540 [heap]
09-08 19:39:30.085: INFO/DEBUG(28): 475fad30 000000b3
09-08 19:39:30.085: INFO/DEBUG(28): 475fad34 000002d4
09-08 19:39:30.085: INFO/DEBUG(28): 475fad38 000001e0
09-08 19:39:30.085: INFO/DEBUG(28): 475fad3c acf153d1 /system/lib/libpixelflinger.so
09-08 19:39:31.444: DEBUG/Zygote(30): Process 860 terminated by signal (11)
09-08 19:39:31.454: INFO/ActivityManager(52): Process com.samples.android.MyExample (pid 860) has died.
09-08 19:39:31.465: INFO/WindowManager(52): WIN DEATH: Window{44dbc0b0 com.samples.android.MyExample/com.samples.android.MyExample.polygonActivity paused=false}
09-08 19:39:31.465: INFO/WindowManager(52): WIN DEATH: Window{44ec8d30 com.samples.android.MyExample/com.samples.android.MyExample.polygonsTabActivity paused=false}
09-08 19:39:31.474: INFO/ActivityManager(52): Start proc com.samples.android.MyExample for activity com.samples.android.MyExample/.polygonsTabActivity: pid=879 uid=10028 gids={3003}
09-08 19:39:31.474: INFO/WindowManager(52): WIN DEATH: Window{44e47ee0 SurfaceView paused=false}
09-08 19:39:31.565: DEBUG/ddm-heap(879): Got feature list request
09-08 19:39:31.595: INFO/UsageStats(52): Unexpected resume of com.samples.android.MyExample while already resumed in com.samples.android.MyExample
09-08 19:39:31.725: DEBUG/dalvikvm(879): GC freed 702 objects / 55456 bytes in 46ms
09-08 19:39:31.785: DEBUG/dalvikvm(879): GC freed 73 objects / 2888 bytes in 34ms
09-08 19:39:31.955: WARN/PhoneWindow(879): Previously focused view reported id 16908298 during save, but can't be found during restore.
09-08 19:39:32.075: WARN/InputManagerService(52): Got RemoteException sending setActive(false) notification to pid 860 uid 10028
09-08 19:39:32.355: INFO/ActivityManager(52): Displayed activity com.samples.android.MyExample/.polygonsTabActivity: 897 ms (total 897 ms)
09-08 19:39:33.525: DEBUG/dalvikvm(52): GC freed 1330 objects / 60912 bytes in 73ms
polygon
i am rotating a polygon using Android openGLES1.0 . if i change orientation of the device(Landscape to portrait viceversa) continuously 2,3 times my activity have GLSurfaceView dies.it results to previous Activity(screen).logcat is showing follwing messages.
please help me.
Here is my Log:
09-08 19:39:29.865: INFO/DEBUG(28): *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
09-08 19:39:29.865: INFO/DEBUG(28): Build fingerprint: 'generic/sdk/generic/:2.1-update1/ECLAIR/35983:eng/test-keys'
09-08 19:39:29.865: INFO/DEBUG(28): pid: 860, tid: 878 >>> com.samples.android.MyExample <<<
09-08 19:39:29.865: INFO/DEBUG(28): signal 11 (SIGSEGV), fault addr 46aff000
09-08 19:39:29.865: INFO/DEBUG(28): r0 46aff000 r1 ffffffff r2 00000268 r3 ffffffff
09-08 19:39:29.865: INFO/DEBUG(28): r4 00000120 r5 46afeec8 r6 000003c0 r7 00000640
09-08 19:39:29.865: INFO/DEBUG(28): r8 475fad88 r9 42f26ee4 10 42f26ecc fp 0011dcf0
09-08 19:39:29.865: INFO/DEBUG(28): ip ffffffff sp 475fad1c lr ffffffff pc afb043f4 cpsr 20000010
09-08 19:39:30.005: INFO/DEBUG(28): #00 pc 000043f4 /system/lib/libcutils.so
09-08 19:39:30.025: INFO/DEBUG(28): #01 pc 00015284 /system/lib/libpixelflinger.so
09-08 19:39:30.025: INFO/DEBUG(28): #02 pc 000153cc /system/lib/libpixelflinger.so
09-08 19:39:30.025: INFO/DEBUG(28): #03 pc 00014b84 /system/lib/egl/libGLES_android.so
09-08 19:39:30.025: INFO/DEBUG(28): #04 pc 0000f1f4 /system/lib/libdvm.so
09-08 19:39:30.025: INFO/DEBUG(28): #05 pc 00037fcc /system/lib/libdvm.so
09-08 19:39:30.035: INFO/DEBUG(28): #06 pc 00031642 /system/lib/libdvm.so
09-08 19:39:30.035: INFO/DEBUG(28): #07 pc 00013f58 /system/lib/libdvm.so
09-08 19:39:30.035: INFO/DEBUG(28): #08 pc 00019888 /system/lib/libdvm.so
09-08 19:39:30.035: INFO/DEBUG(28): #09 pc 00018d5c /system/lib/libdvm.so
09-08 19:39:30.045: INFO/DEBUG(28): #10 pc 0004d6d0 /system/lib/libdvm.so
09-08 19:39:30.045: INFO/DEBUG(28): #11 pc 0004d702 /system/lib/libdvm.so
09-08 19:39:30.055: INFO/DEBUG(28): #12 pc 00041c78 /system/lib/libdvm.so
09-08 19:39:30.055: INFO/DEBUG(28): #13 pc 00010000 /system/lib/libc.so
09-08 19:39:30.055: INFO/DEBUG(28): #14 pc 0000fad4 /system/lib/libc.so
09-08 19:39:30.055: INFO/DEBUG(28): code around pc:
09-08 19:39:30.055: INFO/DEBUG(28): afb043e4 e1b03103 24801004 e1a03001 e2522020
09-08 19:39:30.065: INFO/DEBUG(28): afb043f4 28a0500a 28a0500a 2afffffb e2822020
09-08 19:39:30.065: INFO/DEBUG(28): afb04404 e1b02e02 28a0500a 48a04002 e1b02102
09-08 19:39:30.065: INFO/DEBUG(28): code around lr:
09-08 19:39:30.065: INFO/DEBUG(28): stack:
09-08 19:39:30.065: INFO/DEBUG(28): 475facdc 00000000
09-08 19:39:30.065: INFO/DEBUG(28): 475face0 bf8295fb
09-08 19:39:30.065: INFO/DEBUG(28): 475face4 bf800000
09-08 19:39:30.065: INFO/DEBUG(28): 475face8 00000000
09-08 19:39:30.065: INFO/DEBUG(28): 475facec 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475facf0 c0014afd
09-08 19:39:30.075: INFO/DEBUG(28): 475facf4 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475facf8 40c19648
09-08 19:39:30.075: INFO/DEBUG(28): 475facfc 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475fad00 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475fad04 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475fad08 00000000
09-08 19:39:30.075: INFO/DEBUG(28): 475fad0c 40805851
09-08 19:39:30.075: INFO/DEBUG(28): 475fad10 df002777
09-08 19:39:30.075: INFO/DEBUG(28): 475fad14 e3a070ad
09-08 19:39:30.075: INFO/DEBUG(28): 475fad18 00000000
09-08 19:39:30.075: INFO/DEBUG(28): #00 475fad1c acf15287 /system/lib/libpixelflinger.so
09-08 19:39:30.075: INFO/DEBUG(28): #01 475fad20 bf8295fb
09-08 19:39:30.085: INFO/DEBUG(28): 475fad24 0000ffff [heap]
09-08 19:39:30.085: INFO/DEBUG(28): 475fad28 00000000
09-08 19:39:30.085: INFO/DEBUG(28): 475fad2c 003e8540 [heap]
09-08 19:39:30.085: INFO/DEBUG(28): 475fad30 000000b3
09-08 19:39:30.085: INFO/DEBUG(28): 475fad34 000002d4
09-08 19:39:30.085: INFO/DEBUG(28): 475fad38 000001e0
09-08 19:39:30.085: INFO/DEBUG(28): 475fad3c acf153d1 /system/lib/libpixelflinger.so
09-08 19:39:31.444: DEBUG/Zygote(30): Process 860 terminated by signal (11)
09-08 19:39:31.454: INFO/ActivityManager(52): Process com.samples.android.MyExample (pid 860) has died.
09-08 19:39:31.465: INFO/WindowManager(52): WIN DEATH: Window{44dbc0b0 com.samples.android.MyExample/com.samples.android.MyExample.polygonActivity paused=false}
09-08 19:39:31.465: INFO/WindowManager(52): WIN DEATH: Window{44ec8d30 com.samples.android.MyExample/com.samples.android.MyExample.polygonsTabActivity paused=false}
09-08 19:39:31.474: INFO/ActivityManager(52): Start proc com.samples.android.MyExample for activity com.samples.android.MyExample/.polygonsTabActivity: pid=879 uid=10028 gids={3003}
09-08 19:39:31.474: INFO/WindowManager(52): WIN DEATH: Window{44e47ee0 SurfaceView paused=false}
09-08 19:39:31.565: DEBUG/ddm-heap(879): Got feature list request
09-08 19:39:31.595: INFO/UsageStats(52): Unexpected resume of com.samples.android.MyExample while already resumed in com.samples.android.MyExample
09-08 19:39:31.725: DEBUG/dalvikvm(879): GC freed 702 objects / 55456 bytes in 46ms
09-08 19:39:31.785: DEBUG/dalvikvm(879): GC freed 73 objects / 2888 bytes in 34ms
09-08 19:39:31.955: WARN/PhoneWindow(879): Previously focused view reported id 16908298 during save, but can't be found during restore.
09-08 19:39:32.075: WARN/InputManagerService(52): Got RemoteException sending setActive(false) notification to pid 860 uid 10028
09-08 19:39:32.355: INFO/ActivityManager(52): Displayed activity com.samples.android.MyExample/.polygonsTabActivity: 897 ms (total 897 ms)
09-08 19:39:33.525: DEBUG/dalvikvm(52): GC freed 1330 objects / 60912 bytes in 73ms
polygon
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以禁用方向更改。不过,根据您正在做的事情,这可能不可行。
You could disable the orientation change. Depending upon what you are doing though, this may not be feasible.
如果您使用的是 API 3+,请尝试使用 view.setPreserveEGLContextOnPause(true)
Try using view.setPreserveEGLContextOnPause(true) if you're using API 3+