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.preference.PreferenceManager;

public class Main {
    public static void saveLong(Context ctx, String key, long value) {
        getDefaultPrefsEditor(ctx).putLong(key, value).apply();
    }

    public static SharedPreferences.Editor getDefaultPrefsEditor(Context ctx) {
        return PreferenceManager.getDefaultSharedPreferences(ctx.getApplicationContext()).edit();
    }
}