@Override
protected void onDraw(Canvas canvas){
super.onDraw(canvas);
Paint paint = new Paint();
canvas.drawPaint(paint);
paint.setStyle(Paint.Style.FILL);
paint.setColor(Color.WHITE);
update();
canvas.drawCircle(XC, YC, radius, paint);
}
SurfaceView 中的 render 方法第一次最小化程序 - 展开时一切正常。当重折叠是错误时
04-29 22:57:16.959: E/AndroidRuntime(4813): FATAL EXCEPTION: Thread-23150
04-29 22:57:16.959: E/AndroidRuntime(4813): java.lang.NullPointerException
04-29 22:57:16.959: E/AndroidRuntime(4813): at com.example.blindballtest.GameField.onDraw(GameField.java:10 1)
04-29 22:57:16.959: E/AndroidRuntime(4813): at com.example.blindballtest.ThreadGame.run(ThreadGame.java:42)
请告诉我,出了什么问题以及如何解决?
对不起我的英语不好。