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 {
    protected static String PREFS_NAME = "my_pref";

    public static int getSharedPreferencesInt(Context context, String key, int _default) {
        SharedPreferences preferences = context.getSharedPreferences(PREFS_NAME, 0);
        return preferences.getInt(key, _default);
    }
}