安卓surfaceview不再是可见的其他活动后回surfaceview

2023-09-12 22:24:27 作者:八百逗比奔北啵!

我在开发一些Android程序的问题...

i have a question in developing some android program...

我使用surfaceview相机preVIEW。它工作正常,但有一个问题,当我开始其他活动(点击东西),然后从该活动回来。在这之后,surfaceview不再可见。 (但onclicklistener是工作)

i use surfaceview for camera preview. it works fine, but has one problem when i start other activity (by clicking something) and then back from that activity. after that, surfaceview is no longer visible. (but onclicklistener is working)

但是当我发生surfacecreated /由单一的活动显示/隐藏surfaceview destoryed,它的工作原理很不错的。

but when i occur surfacecreated/destoryed by visible/invisible surfaceview in single activity, it works very good.

PLZ给我任何帮助。

plz give me any help.

推荐答案

这是一个2.0和2.1 UPDATE1问题。无法复制的2.2和1.5,1.6。 在SurfaceView的画布只是显示从另一项活动回来后的黑色。 如果你碰巧找到一个解决办法,请注意我。

This is a 2.0 and 2.1-update1 issue. Was unable to reproduce on 2.2 and 1.5, 1.6. Canvas of the SurfaceView just displays black after returning from another activity. If you happen to find a workaround please note me.