@Override protected void onPause() { SharedPreferences prefs = getSharedPreferences("CatTailCatchData", MODE_PRIVATE); SharedPreferences.Editor editor = prefs.edit(); String tmpScore = Integer.toString(gpv.getScore()); editor.putString("GameScore", tmpScore); editor.commit(); super.onPause(); gpv.killThread(); }
@Override protected void onResume() { SharedPreferences prefs = getSharedPreferences("CatTailCatchData", MODE_PRIVATE); String tmpScore = prefs.getString("GameScore", "1"); gpv.setScore(Integer.valueOf(tmpScore)); super.onResume(); }
@Override protected void onDestroy() { super.onDestroy(); gpv.onDestroy(); }