/
static Graphics _graphics;//提供外部使用;
//错误写法:(1)
public void paint(Graphics g){
if(_graphics==null)
_graphics = g;
}
//正确写法: (2)
public void paint(Graphics g){
_graphics = g;
}
/
这是前几天跟一个同事测试出来的,使用(1)写法一般情况下没问题,但在游戏挂起返回后,会死在paint方法里;虽然简单,但容易忽视,所以记录下来,希望对大家有用~~