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 PREFS = "cac";
    private static final String PREF_FIRST_RUN = "is_first_run";
    /**
     * Default mode for accessing shared preferences.
     */
    private static final int MODE = Context.MODE_PRIVATE;

    public static void setFirstRunComplete(boolean value, Context context) {
        SharedPreferences.Editor prefsEditor = context.getSharedPreferences(PREFS, MODE).edit();
        prefsEditor.putBoolean(PREF_FIRST_RUN, false);
        prefsEditor.commit();
    }
}