经研究,我推荐这种写法:
<SPAN xmlns=\"http://www.w3.org/1999/xhtml\">/*自定义线程*/
class MyThread implements Runnable{
public void run() {
// TODO Auto-generated method stub
// 定义自己的变量
while(!Thread.currentThread().isInterrupted()){
try {
doSomeThingNeed();//需要更新的操作
//休眠控制最大帧率为每秒3绘制30次
Thread.sleep(30);
} catch (Exception e) {
// TODO: handle exception
Log.v(tag2, \"DrawSurfaceView:绘制失败...\");
Thread.currentThread().interrupt();
}
}
}</SPAN>
本文地址:https://www.stayed.cn/item/14623
转载请注明出处。
本站部分内容来源于网络,如侵犯到您的权益,请 联系我