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_LAST_PHONE_COUNT = "last_phone_count";

    static void saveLastPhoneCount(Context context, int count) {
        SharedPreferences prefs = context.getSharedPreferences(AGE_PREFERENCES, Context.MODE_PRIVATE);
        Editor editor = prefs.edit();
        editor.putInt(AGE_LAST_PHONE_COUNT, count);
        editor.commit();
    }
}