动态壁纸崩溃,代码如下
public void render(){
Canvas canvas = null;
try{
canvas = this._surfaceHolder.lockCanvas(null);
synchronized (this._surfaceHolder) {
this.onDraw(canvas);
}
}catch(Exception e){ Log.w("Surface holder ", e.toString());}
finally{
if(canvas != null){
this._surfaceHolder.unlockCanvasAndPost(canvas);
}
}
}
protected void onDraw(Canvas canvas) {
this.renderBackGround(canvas);
for (Renderable renderable : this._fishes) {
renderable.render(canvas);
}
};
崩溃并出现以下错误
06-07 19:49:09.143:E/SurfaceTextureClient(13629):queueBuffer:错误队列缓冲区到 SurfaceTexture,-19
06-07 19:49:09.143: E/SurfaceTextureClient(13629): queueBuffer (handle=0x1c1b30) 失败(没有这样的设备) 06-07 19:49:09.143: W/dalvikvm(13629): threadid=11: 线程退出未捕获的异常(组=0x40c671f8)06-07 19:49:09.143:E/AndroidRuntime(13629):致命异常:线程 692
06-07 19:49:09.143: E/AndroidRuntime(13629): java.lang.IllegalArgumentException
06-07 19:49:09.143:E/AndroidRuntime(13629):在 android.view.Surface.unlockCanvasAndPost(本机方法)
06-07 19:49:09.143: E/AndroidRuntime(13629): 在 com.android.internal.view.BaseSurfaceHolder.unlockCanvasAndPost(BaseSurfaceHolder.java:215)
提前致谢