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.Editor;

public class Main {
    public static final String SHARED_PREFERENCE_NAME = "SP";

    public static void saveBoolean(Context context, String key, boolean value) {
        Editor editor = context.getSharedPreferences(SHARED_PREFERENCE_NAME, Context.MODE_PRIVATE).edit();
        editor.putBoolean(key, value);
        editor.commit();
    }
}