当前位置: 首页>>代码示例>>Java>>正文


Java OnPreferenceClickListener类代码示例

本文整理汇总了Java中android.preference.Preference.OnPreferenceClickListener的典型用法代码示例。如果您正苦于以下问题:Java OnPreferenceClickListener类的具体用法?Java OnPreferenceClickListener怎么用?Java OnPreferenceClickListener使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


OnPreferenceClickListener类属于android.preference.Preference包,在下文中一共展示了OnPreferenceClickListener类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: initSettings

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
private void initSettings() {
	initTunnelSettings();
	initAudioSettings();
	initVideoSettings();
	initCallSettings();
	initChatSettings();
	initNetworkSettings();
	initAdvancedSettings();

	findPreference(getString(R.string.pref_add_account_key)).setOnPreferenceClickListener(new OnPreferenceClickListener() {
		@Override
		public boolean onPreferenceClick(Preference preference) {
			int nbAccounts = mPrefs.getAccountCount();
			LinphoneActivity.instance().displayAccountSettings(nbAccounts);
			return true;
		}
	});
}
 
开发者ID:treasure-lau,项目名称:Linphone4Android,代码行数:19,代码来源:SettingsFragment.java

示例2: onCreate

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);
	addPreferencesFromResource(R.xml.about_preferences);
	Context context = MakiApplication.getContextOfApplication();
	PreferenceManager.getDefaultSharedPreferences(context);

	//open about dialog
	Preference preferenceabout = findPreference("about");
	preferenceabout.setOnPreferenceClickListener(new OnPreferenceClickListener() {
		@Override
		public boolean onPreferenceClick(Preference preference) {
			AlertDialog.Builder builder =
					new AlertDialog.Builder(getActivity(), R.style.AppCompatAlertDialogStyle);
			builder.setTitle(getResources().getString(R.string.about_header));
			builder.setMessage(Html.fromHtml(getResources().getString(R.string.about_text)));
			builder.setPositiveButton(getResources().getString(R.string.ok), null);
			builder.setNegativeButton(null, null);
			builder.show();

			return true;
		}
	});


}
 
开发者ID:sfilmak,项目名称:MakiLite,代码行数:27,代码来源:Credits.java

示例3: onCreate

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
@Override
  public void onCreate(Bundle savedInstanceState) {
      super.onCreate(savedInstanceState);
      addPreferencesFromResource(R.xml.pref_security);

      findPreference(KEY_PIN_ENABLED).setOnPreferenceClickListener(this);


      pin_set_preference = findPreference(KEY_PIN_SET);
pin_set_preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
	
	@Override
	public boolean onPreferenceClick(Preference preference) {
              SettingsActivity.logSettingEvent(preference.getKey());
		checkPin();
		return false;
	}
});
pin_set_preference.setSummary(SettingsActivity.isPinProtected(getActivity()) ? R.string.pin_set : R.string.pin_disabled);
  }
 
开发者ID:kranthi0987,项目名称:easyfilemanager,代码行数:21,代码来源:SecurityPreferenceFragment.java

示例4: configureSyncSettings

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
private void configureSyncSettings() {
    final Preferences preferences = (Preferences) getActivity();
    final Account account = ChromeSigninController.get(getActivity()).getSignedInUser();
    findPreference(PREF_SYNC_SETTINGS)
            .setOnPreferenceClickListener(new OnPreferenceClickListener() {
                @Override
                public boolean onPreferenceClick(Preference preference) {
                    if (!isVisible() || !isResumed()) return false;

                    if (ProfileSyncService.get() == null) return true;

                    Bundle args = new Bundle();
                    args.putString(SyncCustomizationFragment.ARGUMENT_ACCOUNT, account.name);
                    preferences.startFragment(SyncCustomizationFragment.class.getName(), args);

                    return true;
                }
            });
}
 
开发者ID:rkshuai,项目名称:chromium-for-android-56-debug-video,代码行数:20,代码来源:AccountManagementFragment.java

示例5: onCreate

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
@Override
public void onCreate(Bundle savedInstanceState)
{
	super.onCreate(savedInstanceState);
       addPreferencesFromResource(R.xml.preferences);
       
       Preference search = findPreference(SEARCH_KEY);
       Preference help = findPreference(HELP_KEY);
       
       initializeLists();
       
       getPreferenceScreen().getSharedPreferences().registerOnSharedPreferenceChangeListener(this);
       
       search.setOnPreferenceClickListener(new OnPreferenceClickListener() {
		public boolean onPreferenceClick(Preference preference) {
			DuckDuckGoSettings.this.onSearchRequested();
			return true;
		}
	});

       help.setIntent(new Intent(this, Help.class));
}
 
开发者ID:sdrausty,项目名称:buildAPKsApps,代码行数:23,代码来源:DuckDuckGoSettings.java

示例6: onCreate

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
@Override
public void onCreate(final Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    getPreferenceManager().setSharedPreferencesName(MainActivity.PREF_NAME);
    addPreferencesFromResource(R.xml.preferences);
    
    final ListPreference listPreference = null;
    //listPreference = (ListPreference) findPreference(getResources().getString(R.string.const_pref_encoding));
    if (listPreference != null) {
        setListPreferenceData(listPreference);
    
        listPreference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
            @Override
            public boolean onPreferenceClick(Preference preference) {
    
                setListPreferenceData(listPreference);
                return false;
            }
        });
    }            
}
 
开发者ID:anokhina,项目名称:AudioBookPlayer,代码行数:22,代码来源:SettingsActivity.java

示例7: onCreate

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
@Override
public void onCreate(final Bundle savedInstanceState) {
	super.onCreate(savedInstanceState);

	// Load the preferences from an XML resource
	addPreferencesFromResource(R.xml.preferences);

	// click on clear button
	Preference clear = findPreference("clear_card");
	clear.setOnPreferenceClickListener(new OnPreferenceClickListener() {

		@Override
		public boolean onPreferenceClick(final Preference preference) {
			HomeActivity activity = (HomeActivity) getActivity();
			if (activity != null) {
				activity.clear();
				CroutonUtils.display(activity, getString(R.string.card_deleted), CoutonColor.GREEN);
				activity.backToHomeScreen();
			}
			return true;
		}
	});

}
 
开发者ID:JackuyLiu,项目名称:Android-NFC-Paycard-Reader,代码行数:25,代码来源:ConfigurationFragment.java

示例8: createAddAccountPreference

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
/**
 * Create the preference for allow adding new accounts
 */
private void createAddAccountPreference() {
    Preference addAccountPref = new Preference(this);
    addAccountPref.setKey("add_account");
    addAccountPref.setTitle(getString(R.string.prefs_add_account));
    mAccountsPrefCategory.addPreference(addAccountPref);

    addAccountPref.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        @Override
        public boolean onPreferenceClick(Preference preference) {
            AccountManager am = AccountManager.get(getApplicationContext());
            am.addAccount(MainApp.getAccountType(), null, null, null, Preferences.this,
                    null, null);
            return true;
        }
    });

}
 
开发者ID:skymania,项目名称:Cirrus,代码行数:21,代码来源:Preferences.java

示例9: initDependencies

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
private void initDependencies(){
    final Preference buildDepend = findPreference(BUILD_DEPENDS);
    buildDepend.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        @Override
        public boolean onPreferenceClick(final Preference preference) {
        	
        	final WebView webView = new WebView(mContext);
            webView.loadUrl("file:///android_asset/licenses.html");
            new AlertDialog.Builder(mContext)
                    .setTitle(R.string.dependencies_title)
                    .setView(webView)
                    .setPositiveButton(android.R.string.ok, null)
                    .create()
                    .show();
            return true;
        }
    });
}
 
开发者ID:hubcarl,项目名称:mobile-manager-tool,代码行数:19,代码来源:SettingsHolder.java

示例10: onCreate

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
@SuppressWarnings("deprecation")
@Override
protected void onCreate(Bundle bundle) {
  super.onCreate(bundle);
  addPreferencesFromResource(R.xml.sensor_settings);

  boolean hasAntSupport = AntInterface.hasAntSupport(this);

  configSensorType(hasAntSupport);

  findPreference(getString(R.string.settings_sensor_bluetooth_pairing_key))
      .setOnPreferenceClickListener(new OnPreferenceClickListener() {
        public boolean onPreferenceClick(Preference preference) {
          Intent settingsIntent = new Intent(Settings.ACTION_BLUETOOTH_SETTINGS);
          startActivity(settingsIntent);
          return true;
        }
      });

  if (!hasAntSupport) {
    PreferenceScreen rootPreferenceScreen = (PreferenceScreen) findPreference(
        getString(R.string.settings_sensor_root_key));
    rootPreferenceScreen.removePreference(
        findPreference(getString(R.string.settings_sensor_ant_key)));
  }
}
 
开发者ID:Plonk42,项目名称:mytracks,代码行数:27,代码来源:SensorSettingsActivity.java

示例11: updateAntSensor

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
/**
 * Updates an ant sensor.
 * 
 * @param preferenceKey the preference key
 * @param valueKey the value key
 * @param enabled true if enabled
 */
@SuppressWarnings("deprecation")
private void updateAntSensor(int preferenceKey, final int valueKey, boolean enabled) {
  Preference preference = findPreference(getString(preferenceKey));
  if (preference != null) {
    preference.setEnabled(enabled);
    int deviceId = PreferencesUtils.getInt(this, valueKey, AntSensorManager.WILDCARD);
    if (deviceId == AntSensorManager.WILDCARD) {
      preference.setSummary(R.string.settings_sensor_ant_not_connected);
    } else {
      preference.setSummary(getString(R.string.settings_sensor_ant_paired, deviceId));
    }
    preference.setOnPreferenceClickListener(new OnPreferenceClickListener() {
        @Override
      public boolean onPreferenceClick(Preference pref) {
        PreferencesUtils.setInt(SensorSettingsActivity.this, valueKey, AntSensorManager.WILDCARD);
        pref.setSummary(R.string.settings_sensor_ant_not_connected);
        return true;
      }
    });
  }
}
 
开发者ID:Plonk42,项目名称:mytracks,代码行数:29,代码来源:SensorSettingsActivity.java

示例12: initializeShowCustomBottomSheetPreference

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
/**
 * Initializes the preference, which allows to show a bottom sheet with custom content.
 */
private void initializeShowCustomBottomSheetPreference() {
    Preference showCustomBottomSheetPreference =
            findPreference(getString(R.string.show_custom_bottom_sheet_preference_key));
    showCustomBottomSheetPreference
            .setOnPreferenceClickListener(new OnPreferenceClickListener() {

                @Override
                public boolean onPreferenceClick(final Preference preference) {
                    initializeCustomBottomSheet();
                    customBottomSheet.show();
                    return true;
                }

            });
}
 
开发者ID:michael-rapp,项目名称:AndroidBottomSheet,代码行数:19,代码来源:PreferenceFragment.java

示例13: initializeShowIntentBottmSheetPreference

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
/**
 * Initializes the preference, which allows to display the applications, which are suited for
 * handling an intent.
 */
private void initializeShowIntentBottmSheetPreference() {
    Preference showIntentBottomSheetPreference =
            findPreference(getString(R.string.show_intent_bottom_sheet_preference_key));
    showIntentBottomSheetPreference
            .setOnPreferenceClickListener(new OnPreferenceClickListener() {

                @Override
                public boolean onPreferenceClick(Preference preference) {
                    initializeIntentBottomSheet();
                    intentBottomSheet.show();
                    return true;
                }

            });
}
 
开发者ID:michael-rapp,项目名称:AndroidBottomSheet,代码行数:20,代码来源:PreferenceFragment.java

示例14: updateMapSettingsPreference

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
private boolean updateMapSettingsPreference(final String mapProviderName) {
    final DPMapProvider mapProvider = DPMapProvider.getMapProvider(mapProviderName);
    if (mapProvider == null)
        return false;

    final Preference providerPrefs = findPreference(getText(R.string.pref_map_provider_settings_key));
    if (providerPrefs != null) {
        providerPrefs.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
            @Override
            public boolean onPreferenceClick(Preference preference) {
                startActivity(new Intent(getActivity(), MapPreferencesActivity.class).putExtra(
                        MapPreferencesActivity.EXTRA_MAP_PROVIDER_NAME, mapProviderName));
                return true;
            }
        });
    }
    return true;
}
 
开发者ID:jiaminghan,项目名称:droidplanner-master,代码行数:19,代码来源:SettingsFragment.java

示例15: onActivityResult

import android.preference.Preference.OnPreferenceClickListener; //导入依赖的package包/类
/**
 * {@inheritDoc}
 */
@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    if (requestCode == TEXT_TO_SPEECH_CHECK_CODE) {
        Preference ttsWarningPreference = findPreference("tts_warning");

        if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
            ttsWarningPreference.setEnabled(false);
        } else {
            ttsWarningPreference.setEnabled(true);
            ttsWarningPreference.setOnPreferenceClickListener(new OnPreferenceClickListener() {

                public boolean onPreferenceClick(Preference preference) {
                    Intent installIntent = new Intent();
                    installIntent.setAction(TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
                    startActivity(installIntent);
                    return true;
                }
            });
        }
    }

    super.onActivityResult(requestCode, resultCode, data);
}
 
开发者ID:harleensahni,项目名称:media-button-router,代码行数:27,代码来源:MediaButtonConfigure.java


注:本文中的android.preference.Preference.OnPreferenceClickListener类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。