Exception locking surface
E/SurfaceHolder( 2306): java.lang.IllegalArgumentException
E/SurfaceHolder( 2306): at android.view.Surface.lockCanvasNative(Native Method)
E/SurfaceHolder( 2306): at android.view.Surface.lockCanvas(Surface.java:76)
E/SurfaceHolder( 2306): at android.view.SurfaceView$4.internalLockCanvas(SurfaceView.java:745)
E/SurfaceHolder( 2306): at android.view.SurfaceView$4.lockCanvas(SurfaceView.java:725)
E/SurfaceHolder( 2306): at cn.hz.d9.dsn.views.WelcomeView$ViewDrawThread.run(WelcomeView.java:593)
W/System.err( 2306): java.lang.NullPointerException
public void run() {
while(flag){
float Tiem = System.nanoTime();
Canvas canvas=null;
try {
canvas=surfaceHolder.lockCanvas();
synchronized(surfaceHolder){
view.draw(canvas);
}
} catch (Exception e) {
e.printStackTrace();
}finally{
if(canvas!=null)
{
surfaceHolder.unlockCanvasAndPost(canvas);
}
}
try {
Thread.sleep(timeSleep);
} catch (InterruptedException e) {
e.printStackTrace();
}
Dtime = (System.nanoTime() - Tiem)/1000/1000/1000;
}
}
可能有surface未释放。需要全局log。转framwork组搞吧。这不一定是你的app引起的。需要总体把握。
你这问题,着实描述的模糊。
额 没写过这个东西,上网查了下貌似最大可能是循环时画布被锁定了把
CSDN移动问答
这个貌似和你的问题很像
canvas=surfaceHolder.lockCanvas();
if(null==canvas){
continue;
}
加载webview数据时,报了这个错怎么解决?有人遇到过吗?