init Preferences by setting default value - Android android.content

Android examples for android.content:SharedPreferences

Description

init Preferences by setting default value

Demo Code

import android.content.Context;
import android.preference.PreferenceManager;

public class Main {

  public static void initPreferences(Context context, int resId) {
    PreferenceManager.setDefaultValues(context, resId, false);
  }/*from w  w  w .ja va 2 s. c  om*/

}

Related Tutorials