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 {
    public static final String APP_START_KEY = "isFirst";
    public static final String APP_START_FIRST = "manhua_first";

    public static boolean isFirst(Context context) {
        SharedPreferences preferences = context.getSharedPreferences(APP_START_FIRST, Context.MODE_PRIVATE);
        boolean isFirst = preferences.getBoolean(APP_START_KEY, true);
        if (isFirst) {
            preferences.edit().putBoolean(APP_START_KEY, false).commit();
        }
        return isFirst;
    }
}