我正在尝试调用该Log.i
方法来测试视图的刷新率:
public class GameView extends View {
public GameView(Context context) {
super(context);
}
@Override
protected void onDraw(Canvas canvas) {
super.onDraw(canvas);
canvas.drawColor(Color.WHITE);
Log.i("OnDraw","ping");
invalidate();
}
为什么这不起作用?
public class GameUI extends Activity implements OnClickListener, OnTouchListener {
/** Called when the activity is first created. */
GameView gameview;
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
gameview = new GameView(this);
setContentView(gameview);
}