surfaceView中的线程问题

============问题描述============


我在surfaceView中的surfaceCreated方法中start线程,但是当我start一个其他activity后,又finish掉那个acvitity回来,又会走到这个surfaceCreated方法,这时候走到线程的start方法,它会报错Thread already exists,然后我加了判断,不让它再次start,可效果是并没有在执行绘图线程

============解决方案1============


你start一个其他的activity的时候,你的surfaceView应该会走surfaceDestroyed,你debug一下看看。这时候你的线程就被中断了。

============解决方案2============


难道是实现callback方法?
posted @ 2014-10-23 17:00  android开发教程  阅读(482)  评论(0编辑  收藏  举报
我要啦免费统计