public void onPause() { if (this.kenKenGrid.mGridSize > 3) { this.kenKenGrid.mPlayTime = System.currentTimeMillis() - starttime; mTimerHandler.removeCallbacks(playTimer); // NB: saving solved games messes up the timer? SaveGame saver = new SaveGame(); saver.Save(this.kenKenGrid); } super.onPause(); TapjoyConnect.getTapjoyConnectInstance().appPause(); }
public void restoreSaveGame(SaveGame saver) { try { if (saver.Restore(this.kenKenGrid)) { startFreshGrid(false); if (!this.kenKenGrid.isSolved()) this.kenKenGrid.mActive = true; else { this.kenKenGrid.mActive = false; this.kenKenGrid.mSelectedCell.mSelected = false; this.actions[1].setVisibility(View.INVISIBLE); titleContainer.setBackgroundColor(0xFF0099CC); mTimerHandler.removeCallbacks(playTimer); } this.kenKenGrid.invalidate(); } else { newGameDialog(); } } catch (Exception e) { newGameDialog(); } }