Code example for SharedPreferences.Editor: Saving app preferences

Methods: clear, commit

0
		selectedServer = defaultLoginServers.get(0);
		customServer = null;
 
		// Update pref 
		SharedPreferences.Editor editor = settings.edit();
        editor.clear();
        editor.commit();
	} 
 
	/** 
	 * Return production and sandbox as the login servers (only called when servers.xml is missing) 
	 */ 
	List<LoginServer> getLegacyLoginServers() {
		SalesforceR salesforceR = ForceApp.APP.getSalesforceR();
		List<LoginServer> loginServers = new ArrayList<LoginServer>();
 
		int index = 0;
		LoginServer productionServer = new LoginServer(ctx.getString(salesforceR.stringAuthLoginProduction()), PRODUCTION_LOGIN_URL, index++, false);
		loginServers.add(productionServer);
		Log.i("LoginServerManager.getLegacyLoginServers", "Read " + productionServer + " from servers.xml");