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 {
    public static final String MUTE_STATE = "Mute_state";
    public static final String PREFS_NAME = "AUTO_UPDATE_DICT";

    public static void setMuteState(Context context, boolean is_Mute) {
        if (context != null) {
            SharedPreferences settings = context.getSharedPreferences(PREFS_NAME, 0);
            SharedPreferences.Editor editor = settings.edit();
            editor.putBoolean(MUTE_STATE, is_Mute);
            editor.commit();
        }
    }
}