Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;
import android.content.SharedPreferences;
import android.os.Build;

public class Main {
    private static final String ARG_USER_KEY = "be.artoria.belfort";
    private static Context CONTEXT;

    @SuppressWarnings("NewApi")
    private static SharedPreferences getPrefs() {
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
            return CONTEXT.getSharedPreferences(ARG_USER_KEY, Context.MODE_MULTI_PROCESS);
        } else {
            return CONTEXT.getSharedPreferences(ARG_USER_KEY, Context.MODE_PRIVATE);
        }
    }
}