Preference setOnPreferenceClickListener - 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 setOnPreferenceClickListener method.

This code example shows how to use the following methods:setOnPreferenceClickListener, setSummary, Preference.setIcon, Preference.setTitle
8
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnPreferenceClickListener
    public static void setOnPreferenceClickListener( PreferenceActivity activity, String key,
            OnPreferenceClickListener listener )
    { 
        Preference preference = activity.findPreference( key );
        if( preference != null )
            preference.setOnPreferenceClickListener( listener );
    } 
     
    @SuppressWarnings( "deprecation" ) 
    public static void enablePreference( PreferenceActivity activity, String key, boolean enabled )
    { 
        Preference preference = activity.findPreference( key );
        if( preference != null )
            preference.setEnabled( enabled );
    } 
     
    @SuppressWarnings( "deprecation" ) 
    public static void removePreference( PreferenceActivity activity, String keyParent,
            String keyChild )
    { 
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnPreferenceClickListener, setSummary, Preference.setIcon, Preference.setTitle
7
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnPreferenceClickListener, setSummary, setTitle, Preference.setIcon
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnPreferenceClickListener, setSummary, setTitle, Preference.setIcon
6
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getText, setIntent, setOnPreferenceClickListener, setSummary
		super.onResume(); 
		// register pref change listener 
		getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
		 
		//TODO updatePreferences() containing following and others 
		pEtFolder.setSummary(pEtFolder.getText());
		setFolderPreferenceClickIntent(); 
		updateIntervalSummary(); 
		updateIntervalTypesEnabled(); 
		updatePTpDailyTime(); 
	} 
 
	// release the sharedPreferenceListener 
	@Override 
	protected void onPause() 
	{ 
		super.onPause(); 
		getPreferenceScreen().getSharedPreferences().unregisterOnSharedPreferenceChangeListener(this);
	} 
	 

5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnPreferenceClickListener
            return; 
        } 
 
        IntentFilter filter = new IntentFilter(BluetoothAdapter.ACTION_SCAN_MODE_CHANGED);
        mContext.registerReceiver(mReceiver, filter);
        mDiscoveryPreference.setOnPreferenceClickListener(this);
        handleModeChanged(mLocalAdapter.getScanMode());
    } 
 
    public void pause() { 
        if (mLocalAdapter == null) {
            return; 
        } 
 
        mUiHandler.removeCallbacks(mUpdateCountdownSummaryRunnable);
        mContext.unregisterReceiver(mReceiver);
        mDiscoveryPreference.setOnPreferenceClickListener(null);
    } 
 
    public boolean onPreferenceClick(Preference preference) {
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnPreferenceClickListener
			final Preference preference, final String packagename, final String search,
			final String alternativeLink) {
		if (preference == null) {
			return; 
		} 
		preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
			@Override 
			public boolean onPreferenceClick(final Preference preference) {
				if (!TextUtils.isEmpty(packagename)) {
					installApp(activity, packagename, alternativeLink);
					return true; 
				} 
				if (!TextUtils.isEmpty(search)) {
					searchApp(activity, search, alternativeLink);
					return true; 
				} 
				return false; 
			} 
		}); 
	} 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnPreferenceClickListener
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		addPreferencesFromResource(preferencesResId);
		 
		loginPreference = findPreference("LoginPreference");
		loginPreference.setOnPreferenceClickListener(this);
	} 
	 
	protected void setPreferencesResource(int preferencesResId) {
		this.preferencesResId = preferencesResId;
	} 
	 
	@Override 
	protected void onResume() { 
		super.onResume(); 
		 
		// Check if we're coming back from the provider's login page 
		Uri uri = getIntent().getData();
		if (uri != null && uri.toString().startsWith(api.getCallbackUrl()) && !api.isLoggedIn()) {
			// This means we're successfully logged in 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:setOnPreferenceClickListener, setChecked
		componentName = new ComponentName(this, AdminReceiver.class);
 
		boolean active = policyManager.isAdminActive(componentName);
 
		m_prefChkReq = (CheckBoxPreference) findPreference("req_admin_switch");
		m_prefChkReq.setOnPreferenceClickListener(this);
		m_prefChkReq.setChecked(active);
		super.onResume(); 
		Log.v("CountService", "onResume");
	} 
 
	public boolean onPreferenceClick(Preference preference) {
		Log.v("CountService", "onPreferenceClick");
		if (preference == m_prefChkReq) {
			boolean active = policyManager.isAdminActive(componentName);
			if (active) {
				policyManager.removeActiveAdmin(componentName);
			} else { 
				Intent intent = new Intent(
						DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN);
5
CodeRank
Experience pair programming with AI  Get Codota for Java

Related Preference setOnPreferenceClickListener Questions & Answers:

setOnPreferenceClickListener Method Overview
Sets the callback to be invoked when this Preference is clicked.
See Code Examples for other Android Preference Methods: