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;

public class Main {
    static void setSetting(Context context, String prefName, String prefData) {
        SharedPreferences.Editor editPrefs = context
                .getSharedPreferences("com.ihelp101.xinsta", Context.MODE_PRIVATE).edit();
        editPrefs.putString(prefName, prefData);
        editPrefs.commit();
    }

    static void setSetting(Context context, String prefName, boolean prefData) {
        SharedPreferences.Editor editPrefs = context
                .getSharedPreferences("com.ihelp101.xinsta", Context.MODE_PRIVATE).edit();
        editPrefs.putBoolean(prefName, prefData);
        editPrefs.commit();
    }
}