Android getting the correct values from an arraylist
<p>Okay I'll try describe this the best way I can.</p>

<p>I have a chat application and I am sending a request to receive a list of public channels.
The string that I receive back from the server is:</p>

<pre><code>RESP_PUBLICCHANNELLIST, channelID 1, channelName 1, channelID 2, channelName 2
</code></pre>

<p>And when I add this list to my AlertDialog, it shows each channel and channel ID as a separate channel. I would like to just have the channel name in the AlertDialog and have the channel ID in a map with a key value to it. Is this possible?</p>

<p>Here is my current code I am having problems with:</p>

<pre><code> public void ShowPublicChannelList(){

     String PublicChannelsPost = "";
     PublicChannelsPost = ExecuteCommand(_chatProtocol.ShowPublicChannelList());
     System.out.println("Public Channels: " + PublicChannelsPost);
     _publicChannels.add("New..");

     List &lt;String&gt; responseList = Arrays.asList(PublicChannelsPost.split(","));
        if (responseList.contains("RESP_PUBLICCHANNELLIST")){
            for (int i = 1; i &lt; responseList.size(); i++) {
                _publicChannels.add(responseList.get(i));
                System.out.println("Channels: " + _publicChannels);
            }   
                SetPublicChannelList(_publicChannels);
                }
</code></pre>

<p>Any help would be fantastic!</p>

<p>Thank you!</p>
