Android PreferenceManager - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android PreferenceManager class.

This code example shows how to use the following methods: getBroadcast, getSystemService, getDefaultSharedPreferences
  @Override 
  public void onReceive(Context context, Intent intent) {
    Log.w("DirectoryUpdateReceiver", "Initiating scheduled directory update...");
 
    try { 
      SignalingSocket signalingSocket = new SignalingSocket(context);
      DirectoryResponse response      = signalingSocket.getNumberFilter();
 
      if (response != null) {
        NumberFilter filter = new NumberFilter(response.getFilter(), response.getHashCount());
        filter.serializeToFile(context);
      } 
    } catch (SignalingException se) {
      Log.w("DirectoryUpdateReceiver", se);
    } catch (Exception e) {
      Log.w("DirectoryUpdateReceiver", e);
      return; 
    } 
 
    scheduleDirectoryUpdate(context);

9
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: startService, getDefaultSharedPreferences
import android.preference.PreferenceManager; 
 
public class NetworkReceiver extends BroadcastReceiver {
  @Override 
  public void onReceive(Context context, Intent intent) {
    SharedPreferences prefs=
        PreferenceManager.getDefaultSharedPreferences(context);
 
    if (SyncService.isSyncNeeded(context, prefs)) {
      context.startService(new Intent(context, SyncService.class));
    } 
  } 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: openFileOutput, getDefaultSharedPreferences
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getWindow, getWindowManager, getDefaultSharedPreferences
        super.onCreate(savedInstanceState);
    } 
 
    public static void setBackgroundImage (Activity activity)
    { 
        SharedPreferences settings = PreferenceManager.getDefaultSharedPreferences(activity);
        //int themeId = settings.getInt("theme", R.style.Theme_Gibberbot_Light); 
        boolean themeDark = settings.getBoolean("themeDark", false);
        String themebg = settings.getString("pref_background", "");
         
         
        if (themebg != null && themebg.length() > 0)
        { 
 
            File fileThemeBg = new File(themebg);
            if (!fileThemeBg.exists())
                return; 
             
            if (mThemeBg == null || (!mThemeBg.equals(themebg)))
            { 

7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: startService, getDefaultSharedPreferences
import android.preference.PreferenceManager; 
 
public class NetworkReceiver extends BroadcastReceiver {
  @Override 
  public void onReceive(Context context, Intent intent) {
    SharedPreferences prefs=
        PreferenceManager.getDefaultSharedPreferences(context);
 
    if (SyncService.isSyncNeeded(context, prefs)) {
      context.startService(new Intent(context, SyncService.class));
    } 
  } 
} 
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android PreferenceManager Questions & Answers:

See Code Examples for Android PreferenceManager Methods: