Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
CTB 4-1
private float boxY;
// Handler & Timer
private Handler handler = new Handler();
private Timer timer = new Timer();
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
// ------------
// --- 省略 ---
// ------------
boxY = 500.0f;
timer.schedule(new TimerTask() {
@Override
public void run() {
handler.post(new Runnable() {
@Override
public void run() {
changePos();
}
});
}
}, 0, 20);
}
@Override
public boolean onTouchEvent(MotionEvent event) {
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.