Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Open Source License 

import android.content.Context;
import android.content.SharedPreferences;
import java.util.Collection;

public class Main {
    private static Context context;
    private static final String PRIVATE_CACHE = "PRIVATE_CACHE";

    public static void delete(Collection<String> keys) {
        SharedPreferences preferences = getPrivateSharedPreference();
        SharedPreferences.Editor editor = preferences.edit();
        for (String key : keys) {
            editor.remove(key);
        }
        editor.commit();
    }

    public static SharedPreferences getPrivateSharedPreference() {
        return context.getSharedPreferences(PRIVATE_CACHE, Context.MODE_PRIVATE);
    }
}