Back to project page android-tic-tac-toe.
The source code is released under:
MIT License
If you think the Android project android-tic-tac-toe listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package org.shaon.android.tictactoe; // w w w. j a v a2s . c o m import org.shaon.android.tictactoe.board.Board.GameMode; import android.app.Application; import android.content.SharedPreferences; public class TicTacToeApplication extends Application { public static final String PREFERENCE_TIC_TAC_TOE = "PreferencesTicTacToe"; public static final String PREFERENCE_GAME_MODE = "GameMode"; private GameMode gameMode; @Override public void onCreate() { super.onCreate(); loadGameMode(); } public void loadGameMode() { SharedPreferences settings = getSharedPreferences(PREFERENCE_TIC_TAC_TOE, 0); String gameModeStr = settings.getString(PREFERENCE_GAME_MODE, GameMode.VS_GREEN_ROBOT.toString()); gameMode = GameMode.valueOf(gameModeStr); } /** * @return the gameMode */ public GameMode getGameMode() { return gameMode; } }