Code example for SparseArray

Methods: append

0
    		result.append(1, prefs.getString("userpw", ""));
    		return result;
    	} 
    	 
    	if (ssid.equals(homespotssid)) {
    		SparseArray<String> result = new SparseArray<String>(2);
    		if (prefs.getString("userid_homespot", "") == "" )
    			result.append(0, prefs.getString("userid", ""));
    		else	 
    			result.append(0, prefs.getString("userid_homespot", ""));
    		 
    		if (prefs.getString("userpw_homespot", "") == "" )
    			result.append(1, prefs.getString("userpw", ""));
    		else 
    			result.append(1, prefs.getString("userpw_homespot", ""));
    		 
    		return result;
    	} 
    	 
    	return null; 
    }