解决来电问题,唯一需要做的就是重载Canvas的hideNotify()方法。
just like this:
boolean gameIsPaused;

protected void showNotify() { gameIsPaused = false;
}

protected void hideNotify() {
gameIsPaused = true;
}

private void theMainGameLoop() {
while (gameIsRunning) {
if (!gameIsPaused) {
// process events and update the screen
}
}
}