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;
import android.content.SharedPreferences.Editor;

public class Main {
    protected static String PREFS_NAME = "my_pref";

    public static void putSharedPreferencesLong(Context context, String key, long val) {
        SharedPreferences preferences = context.getSharedPreferences(PREFS_NAME, 0);
        Editor edit = preferences.edit();
        edit.putLong(key, val);
        edit.commit();
    }
}