14.06.2011

setThread()

posted by Karsten

public void setThread(GameThread newThread) { thread = newThread; setOnTouchListener(new View.OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { if(thread!=null) { return thread.onTouch(event); } else return false; } }); this.sensorAccelerometer = new SensorEventListener() { public void onAccuracyChanged(Sensor arg0, int arg1) { // not needed } public void onSensorChanged(SensorEvent event) { if(thread!=null) { if (thread.isAlive()) { thread.onSensorChanged(event); } } } }; setClickable(true); setFocusable(true); }

Share

Place your comment

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