Code example for CheckBoxPreference

Methods: setSummary

0
			mDefaultLaunchActivity.setSummary("Open " + getFreindlyDefaultActivityName(sharedPreferences) + " on launch");
		} else if (key.equals(KEY_WELCOME_MESSAGE)) {
			mDisplayWelcomeMessage.setSummary(sharedPreferences.getBoolean(key, KEY_WELCOME_MESSAGE_DEFAULT_VALUE) ? 
					"Showing twitter feed" : "Hiding twitter feed"); 
		} else if (key.equals(KEY_TRAM_IMAGE)) {
			mDisplayTramImage.setSummary(sharedPreferences.getBoolean(key, KEY_TRAM_IMAGE_DEFAULT_VALUE) ? 
					"Showing tram images" : "Hiding tram images"); 
//		} else if (key.equals(KEY_USE_JSON_API)) { 
//			mUseJSONAPI.setSummary(sharedPreferences.getBoolean(key, KEY_USE_JSON_API_DEFAULT_VALUE) ?  
//					"Using experimental JSON API" : "Using stable SOAP API"); 
		} else if (key.equals(KEY_SEND_STATS)) {
			mSendStats.setSummary(sharedPreferences.getBoolean(key, KEY_SEND_STATS_DEFAULT_VALUE) ? 
					"Sending anonymous usage statistics" : "Not sending anonymous usage statistics"); 
		} 
	} 
 
	private String getFreindlyDefaultActivityName(SharedPreferences sharedPreferences) {
		// Because the default activity setting is saved as an activity name we 
		// need to get the friendly name to show the user 
		// in the summary of the setting 
		String[] defaultActivityEntries = getResources().getStringArray(R.array.defaultActivityEntries);