final Handler handler = new Handler(Looper.getMainLooper());
handler.postDelayed(new Runnable() {
@Override
public void run() {
//Do something after 100ms
}
}, 100);
final Runnable r = new Runnable() {
public void run() {
gameOver();
}
};
handler.postDelayed(r,1000);