14.06.2011

GameView

posted by Karsten

public GameView(Context context, AttributeSet attrs) { super(context, attrs); //Get the holder of the screen and register interest SurfaceHolder holder = getHolder(); holder.addCallback(this); //Set up a handler for messages from GameThread mHandler = new Handler() { @Override public void handleMessage(Message m) { if(m.getData().getBoolean("score")) { mScoreView.setText(m.getData().getString("text")); } else { //So it is a status mStatusView.setVisibility(m.getData().getInt("viz")); mStatusView.setText(m.getData().getString("text")); } } }; }

Share

Place your comment

Please fill your data and comment below.
Name
Email
Website
Your comment