Android PreferenceActivity - 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 PreferenceActivity class.

This code example shows how to use the following methods:startPreferenceFragment
    public void onItemSelected(final AdapterView<?> parent, final View view, final int pos,
            final long id) {
        final LocaleRenderer locale = (LocaleRenderer)parent.getItemAtPosition(pos);
        if (locale.isMoreLanguages()) {
            PreferenceActivity preferenceActivity = (PreferenceActivity)getActivity();
            preferenceActivity.startPreferenceFragment(new UserDictionaryLocalePicker(this), true);
        } else { 
            mContents.updateLocale(locale.getLocaleString());
        } 
    } 
 
    @Override 
    public void onNothingSelected(final AdapterView<?> parent) {
        // I'm not sure we can come here, but if we do, that's the right thing to do. 
        final Bundle args = getArguments();
        mContents.updateLocale(args.getString(UserDictionaryAddWordContents.EXTRA_LOCALE));
    } 
 
    // Called by the locale picker 
    @Override 
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:startActivity, getPackageManager
        return false; 
    } 
 
    public void launchPackage(String targetPackage){
        Intent i = new Intent();
        PackageManager manager = mContext.getPackageManager();
        i = manager.getLaunchIntentForPackage(targetPackage);
        i.addCategory(Intent.CATEGORY_LAUNCHER);
        mContext.startActivity(i);
    } 
 
    public TouchKeyBacklight(PreferenceActivity context) {
        mContext = context;
    } 
 
    @Override 
    public boolean onPreferenceClick(Preference preference) {
        if (isPackageExists(PACKAGE_BLN_PRO)) {
            launchPackage(PACKAGE_BLN_PRO);
        } else if (isPackageExists(PACKAGE_BLN)) {
6
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:findPreference
{ 
    @SuppressWarnings( "deprecation" ) 
    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,
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:startPreferenceFragment
    public void onItemSelected(final AdapterView<?> parent, final View view, final int pos,
            final long id) {
        final LocaleRenderer locale = (LocaleRenderer)parent.getItemAtPosition(pos);
        if (locale.isMoreLanguages()) {
            PreferenceActivity preferenceActivity = (PreferenceActivity)getActivity();
            preferenceActivity.startPreferenceFragment(new UserDictionaryLocalePicker(), true);
        } else { 
            mContents.updateLocale(locale.getLocaleString());
        } 
    } 
 
    @Override 
    public void onNothingSelected(final AdapterView<?> parent) {
        // I'm not sure we can come here, but if we do, that's the right thing to do. 
        final Bundle args = getArguments();
        mContents.updateLocale(args.getString(UserDictionaryAddWordContents.EXTRA_LOCALE));
    } 
 
    // Called by the locale picker 
    @Override 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getContentResolver
        mActivity = activity;
        mSetting = setting;
    } 
 
    public void colorChanged(int color) {
        Settings.System.putInt(mActivity.getContentResolver(), mSetting, color);
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getPreferenceManager
	private String TAG = "JSONParsingInterface";
	 
	public PreferenceScreen ParseJSON(PreferenceActivity activity, Context context, boolean refresh){
		 
		 mContext = context;
		 PreferenceScreen PreferenceRoot = activity.getPreferenceManager().createPreferenceScreen(mContext);
		 InputStream is;
		  
		if(mJSONParsingInterface != null){
			 
			 is = mJSONParsingInterface.DownloadJSONScript(refresh);
			  
			 if(is != null){
				  
			 
				 try { 
					  
					 PreferenceRoot = mJSONParsingInterface.ParseJSONScript(PreferenceRoot,is);
					 mJSONParsingInterface.ParsingCompletedSuccess();
					 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:getContentResolver
        mActivity = activity;
        mSetting = setting;
    } 
 
    public void colorChanged(int color) {
        Settings.System.putInt(mActivity.getContentResolver(), mSetting, color);
    } 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:startPreferencePanel
This code example shows how to use the following methods:getPreferenceManager
 
	private SharedPreferences getSharedPreferences() {
		PreferenceActivity pa = mPreferenceActivityRef.get();
		if (pa == null)
			return null; 
		SharedPreferences sp = pa.getPreferenceManager().getSharedPreferences();
		return sp;
	} 
 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:findPreference
    } 
 
    private void maybeDisableWebsiteSettings(Context context) {
        PreferenceActivity activity = (PreferenceActivity) context;
        final PreferenceScreen screen = (PreferenceScreen)
            activity.findPreference(BrowserSettings.PREF_WEBSITE_SETTINGS);
        screen.setEnabled(false);
        WebStorage.getInstance().getOrigins(new ValueCallback<Map>() {
            public void onReceiveValue(Map webStorageOrigins) {
                if ((webStorageOrigins != null) && !webStorageOrigins.isEmpty()) {
                    screen.setEnabled(true);
                } 
            } 
        }); 
 
        GeolocationPermissions.getInstance().getOrigins(new ValueCallback<Set<String> >() {
            public void onReceiveValue(Set<String> geolocationOrigins) {
                if ((geolocationOrigins != null) && !geolocationOrigins.isEmpty()) {
                    screen.setEnabled(true);
                } 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java

Related Android PreferenceActivity Questions & Answers:

See Code Examples for Android PreferenceActivity Methods: