Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import android.content.Context;
import android.content.SharedPreferences;

public class Main {
    private static final String STORE_NAME = "TestStore";
    private static final String STORE_KEY_PREFIX = "TESY_STORE_";

    public static void storeBoolean(Context context, String key, boolean value) {
        SharedPreferences pre = context.getSharedPreferences(STORE_NAME, Context.MODE_PRIVATE);
        pre.edit().putBoolean(STORE_KEY_PREFIX + key, value).commit();
    }
}