Preference setPersistent - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Preference setPersistent method.

This code example shows how to use the following methods:getSharedPreferences, setPersistent
This code example shows how to use the following methods:setIcon, setIntent, setPersistent, setTitle
    * @param iIconResId 
    */ 
    @SuppressLint("NewApi") 
    private void addFilePreference(File iFile, PreferenceGroup oGroup, int iIconResId)
    { 
        Preference aPref = new Preference(_context);
        aPref.setPersistent(false);
        aPref.setTitle(iFile.getName());
        if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB)
            aPref.setIcon(iIconResId);
        // Use an intent to open with external text editor 
        Intent aIntent = new Intent();
        aIntent.setAction(android.content.Intent.ACTION_VIEW);
        aIntent.setDataAndType(Uri.fromFile(iFile), "text/plain");
        aPref.setIntent(aIntent);
         
        oGroup.addPreference(aPref);
    } 
     
   /** 
6
CodeRank
This code example shows how to use the following methods:getSummary, setPersistent
This code example shows how to use the following methods:getSummary, setPersistent
    }; 
 
    public WifiEnabler(Context context, CheckBoxPreference checkBox) {
        mContext = context;
        mCheckBox = checkBox;
        mOriginalSummary = checkBox.getSummary();
        checkBox.setPersistent(false);
 
        mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
        mIntentFilter = new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION);
        // The order matters! We really should not depend on this. :( 
        mIntentFilter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION);
        mIntentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
    } 
 
    public void resume() { 
        // Wi-Fi state is sticky, so just let the receiver update UI 
        mContext.registerReceiver(mReceiver, mIntentFilter);
        mCheckBox.setOnPreferenceChangeListener(this);
    } 
5
CodeRank
This code example shows how to use the following methods:setPersistent, setSelectable, setTitle
 
      2() {} 
 
      public void add(String var1) {
         DiscoverServicesActivity var2 = DiscoverServicesActivity.this;
         Preference var3 = new Preference(var2);
         var3.setPersistent((boolean)0);
         var3.setSelectable((boolean)0);
         var3.setTitle(var1);
         boolean var4 = DiscoverServicesActivity.this.mServiceList.addPreference(var3);
      } 
   } 
} 
6
CodeRank
This code example shows how to use the following methods:setPersistent, setChecked
            int xLoudSupported = Settings.System.getInt(getContentResolver(), "com.sonyericsson.xloud_enabled", 1);
            mXLoudEnabled.setChecked(xLoudSupported != 0);
        } 
 
        if (mSwIqiEnabled != null) {
            mSwIqiEnabled.setPersistent(false);
            int swIqiEnabled = SystemProperties.getInt("persist.service.swiqi.enable", 0);
            mSwIqiEnabled.setChecked(swIqiEnabled != 0);
        } 
    } 
 
    @Override 
    public boolean onPreferenceTreeClick(PreferenceScreen preferenceScreen, Preference preference) {
        if (preference == mXLoudEnabled) {
            if (mXLoudEnabled != null) {
                Intent intent = new Intent("com.sonyericsson.audioeffectservice.intent.action.XLOUD_REQUEST");
                boolean checked = mXLoudEnabled.isChecked();
                intent.putExtra("com.sonyericsson.audioeffectservice.intent.extra.XLOUD_STATUS", checked ? 1 : 0);
                sendBroadcast(intent);
            } 
5
CodeRank
This code example shows how to use the following methods:getSummary, setPersistent
    }; 
 
    public WifiEnabler(Context context, CheckBoxPreference checkBox) {
        mContext = context;
        mCheckBox = checkBox;
        mOriginalSummary = checkBox.getSummary();
        checkBox.setPersistent(false);
 
        mWifiManager = (WifiManager) context.getSystemService(Context.WIFI_SERVICE);
        mIntentFilter = new IntentFilter(WifiManager.WIFI_STATE_CHANGED_ACTION);
        // The order matters! We really should not depend on this. :( 
        mIntentFilter.addAction(WifiManager.SUPPLICANT_STATE_CHANGED_ACTION);
        mIntentFilter.addAction(WifiManager.NETWORK_STATE_CHANGED_ACTION);
    } 
 
    public void resume() { 
        // Wi-Fi state is sticky, so just let the receiver update UI 
        mContext.registerReceiver(mReceiver, mIntentFilter);
        mCheckBox.setOnPreferenceChangeListener(this);
    } 
4
CodeRank
This code example shows how to use the following methods:setPersistent
This code example shows how to use the following methods:getSummary, setPersistent
	}; 
 
	public WifiApEnabler(Context context, CheckBoxPreference checkBox) {
		mContext = context;
		mCheckBox = checkBox;
		mOriginalSummary = checkBox.getSummary();
		checkBox.setPersistent(false);
 
		mWifiManager = (WifiManager) context
				.getSystemService(Context.WIFI_SERVICE);
		mCm = (ConnectivityManager) mContext
				.getSystemService(Context.CONNECTIVITY_SERVICE);
 
		mWifiRegexs = getTetherableWifiRegexs(mCm);
 
		mIntentFilter = new IntentFilter(getStringField(WifiManager.class,
				"WIFI_AP_STATE_CHANGED_ACTION")); 
		mIntentFilter.addAction(getStringField(ConnectivityManager.class,
				"ACTION_TETHER_STATE_CHANGED")); 
	} 
4
CodeRank
This code example shows how to use the following methods:setPersistent
 
	private void setListeners() { 
		cancelButton.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				mapView.setPersistent(false);
				zoomSpinner.setPersistent(false);
				Preferences.this.setResult(RESULT_CANCELED);
				finish();
			} 
		}); 
		okButton.setOnClickListener(new View.OnClickListener() {
			public void onClick(View view) {
				savePreferences(); 
				Preferences.this.setResult(RESULT_OK);
				finish();
			} 
		}); 
	} 
 
	private void savePreferences() { 
4
CodeRank

Related Preference setPersistent Questions & Answers:

setPersistent Method Overview
Sets whether this Preference is persistent.
See Code Examples for other Android Preference Methods: