Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import android.content.Context;
import android.content.SharedPreferences;

public class Main {
    public static final String USER_INFO = "user_info";
    public static final String USER_ICON = "user_icon";
    public static final String USER_NAME = "user_name";
    public static final String USER_ID = "user_id";
    public static final String USER_PWD = "user_pwd";

    public static void editInfo(Context context, String userName, String userId, String userIcon, String userPwd) {
        SharedPreferences preferences = context.getSharedPreferences(USER_INFO, Context.MODE_PRIVATE);
        preferences.edit().putString(USER_NAME, userName).putString(USER_ICON, userIcon).putString(USER_ID, userId)
                .putString(USER_PWD, userPwd).commit();
    }
}