Android Open Source - TaskManager Preferences






From Project

Back to project page TaskManager.

License

The source code is released under:

Apache License

If you think the Android project TaskManager listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package com.ggstudios.tools.taskmanager;
/*from  w w  w .j  av  a 2 s . c o m*/
import android.content.Context;
import android.content.SharedPreferences;
import android.preference.PreferenceManager;

public class Preferences {
  
  public static final String PREF_SHOW_SYSTEM_APPS = "showSysApps";
  
  private static final String PREFS_NAME = "prefs";
  private static Preferences prefs;
  
  private SharedPreferences settings;
  private SharedPreferences.Editor editor;
  
  private Object editorLock = new Object();
  
  public static Preferences getInstance(){
    return prefs;
  }
  
  public static void initialize(Context context){
    if(prefs == null)
      prefs = new Preferences(context);
  }
  
  private Preferences(Context context){
    settings = PreferenceManager.getDefaultSharedPreferences(context);
    editor = settings.edit();
  }
  
  public void commit(){
    synchronized(editorLock){
      editor.commit();
    }
  }
  
  public SharedPreferences getPrefs(){
    return settings;
  }
  
  public SharedPreferences.Editor getEditor(){
    return editor;
  }
}




Java Source Code List

com.ggstudios.tools.taskmanager.ActivityApps.java
com.ggstudios.tools.taskmanager.ActivityMain.java
com.ggstudios.tools.taskmanager.ActivityProcesses.java
com.ggstudios.tools.taskmanager.ApplicationMain.java
com.ggstudios.tools.taskmanager.DebugLog.java
com.ggstudios.tools.taskmanager.Keys.java
com.ggstudios.tools.taskmanager.Preferences.java
com.ggstudios.tools.taskmanager.SettingsActivity.java