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;
import android.text.TextUtils;

public class Main {
    protected static SharedPreferences createPrefs(Context context, String name, int mode) {
        if (TextUtils.isEmpty(name)) {
            return PreferenceManager.getDefaultSharedPreferences(context.getApplicationContext());
        } else {
            return context.getSharedPreferences(name, mode);
        }
    }
}