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

public class Main {
    static final String AGE_PREFERENCES = "age_preferences";
    static final String AGE_CURRENT_APP_KEY = "current_app_key";

    static void saveCurrentAppKey(Context context, String appKey) {
        if (appKey != null) {
            SharedPreferences prefs = context.getSharedPreferences(AGE_PREFERENCES, Context.MODE_PRIVATE);
            Editor editor = prefs.edit();
            editor.putString(AGE_CURRENT_APP_KEY, appKey);
            editor.commit();
        }
    }
}