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 PREFS_CONTROLLER_STATUS = "prefs_controller_status";

    public static boolean isControllerEnabled(Context context) {
        SharedPreferences prefs = context.getSharedPreferences(context.getPackageName(), Context.MODE_PRIVATE);

        // By default, when first time used, status is enabled
        return prefs.getBoolean(PREFS_CONTROLLER_STATUS, true);

    }
}