Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;
import android.content.SharedPreferences;

public class Main {

    private static final String PREF_FILE = "RADIX_PERSISTANT";

    /**
     * @param context
     * @param key
     * @param defValue
     * @return
     */
    public static boolean getBoolean(Context context, String key, boolean defValue) {
        return getBoolean(PREF_FILE, context, key, defValue);
    }

    public static boolean getBoolean(String prefFile, Context context, String key, boolean defValue) {
        SharedPreferences settings = context.getSharedPreferences(prefFile, Context.MODE_PRIVATE);
        return settings.getBoolean(key, defValue);
    }
}