Code example for LinkedList

Methods: getFirst, size, toArray

0
				// no servers found 
				return; 
			case 1: 
				// single server found, automatically connect 
				//Log.d(TAG, "Updating preferences"); 
				setServer(servers.getFirst());
				return; 
			default: 
				// multiple servers found, present the user with a choice dialog 
				AlertDialog.Builder alert = new AlertDialog.Builder(mActivity);
				alert.setTitle("Choose server");
				final String[] inner_servers = new String[servers.size()];
				servers.toArray(inner_servers);
				alert.setItems(inner_servers,
							   new DialogInterface.OnClickListener() {
								   public void onClick(DialogInterface dialog, int item) {
									   setServer(inner_servers[item]);
								   } 
							   }); 
				alert.show();
				return;