Java tutorial
//package com.java2s; /* * This is the source code of VshGap for Android v. 1.4.x. * It is licensed under GNU GPL v. 2 or later. * You should have received a copy of the license in this archive (see LICENSE). * * Copyright Nikolai Kudashov, 2013-2014. */ import android.content.Context; import android.graphics.Color; public class Main { public static final String THEME_PREFS = "theme"; public static int getIntPref(Context context, String key) { int i = 0; if (key.contains("picker")) { int intColor = context.getSharedPreferences(THEME_PREFS, 0).getInt(key, Color.WHITE); i = intColor; } return i; } }