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 {
    private static final String PREF_EMAIL = "email";

    public static void setUserEmail(final Context context, final String email) {
        SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
        sp.edit().putString(PREF_EMAIL, email).apply();
    }
}