Android AsyncTask only loaded one item into ArrayAdapter?
<p>This only loads on of the titles in the url </p>

<p>It should load all of the items in this list</p>

<p><a href="http://www.gamespy.com/index/release.html" rel="nofollow">http://www.gamespy.com/index/release.html</a></p>

<pre><code>  private class fetcher extends AsyncTask&lt;Void,Void,Void&gt;{
                @Override 
                protected void onPreExecute(){
                     dialog = ProgressDialog.show(HtmlparserExampleActivity.this, "", 
                             "Loading. Please wait...", true);
                     dialog.show();

                }

                @Override
                protected Void doInBackground(Void... arg0) {
                    //Setting the list of gameRelease Arrays

                     Document doc = null;
                            try {
                                doc = Jsoup.connect("http://www.gamespy.com/index/release.html").get();
                            } catch (IOException e) {
                                // TODO Auto-generated catch block
                                e.printStackTrace();
                            }
                            if(doc == null){

                            }
                            else{
                            // Get all td's that are a child of a row - each game has 4 of these
                                Elements games = doc.select("tr&gt;  td.indexList1, tr &gt; td.indexList2");


                                // Iterator over those elements     
                                ListIterator&lt;Element&gt; postIt = games.listIterator();   

                                //Loads all the items until there is no .hasNExt()
                                while (postIt.hasNext()) {     

                                    while (postIt.hasNext()) {     

                                        // Add the game text to the ArrayList     
                                        Element name = postIt.next();
                                         nameString = name.text();

                                        //Get the platform
                                        platform = postIt.next().text();

                                        //Get the URL 
                                        Element url = name.select("a").first();
                                         urlString = url.attr("href");

                                        //Get the Genre of the game
                                         genre = postIt.next().text();

                                        //Get the release date
                                         releaseDate = postIt.next().text();
                                        Log.v("Title", nameString);


                                        //Instantiating the GameReleaseAdapter





                            }

                }

            }
                            return null;
                }
                @Override
                protected void onPostExecute(Void notUsed){
                    dialog.dismiss();

                     ArrayList&lt;GameRelease&gt; gameList = new ArrayList&lt;GameRelease&gt;();
                      HtmlparserExampleActivity.this.setListAdapter(new GameReleaseAdapter(HtmlparserExampleActivity.this, gameList));
                        //Instantiating the GameReleaseAdapter


                        //Set the detals on the game releases to the setter and getter class GameRelease
                        gameList.add(new GameRelease(nameString, platform, genre, releaseDate, urlString));


                }
            }
</code></pre>

<p>}</p>

<p>When an item in the list is clicked i get this exception</p>

<pre><code>08-16 22:15:52.736: ERROR/AndroidRuntime(30528): FATAL EXCEPTION: main
08-16 22:15:52.736: ERROR/AndroidRuntime(30528): java.lang.IndexOutOfBoundsException: Invalid index 0, size is 0
08-16 22:15:52.736: ERROR/AndroidRuntime(30528):     at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:257)
08-16 22:15:52.736: ERROR/AndroidRuntime(30528):     at java.util.ArrayList.get(ArrayList.java:311)
08-16 22:15:52.736: ERROR/AndroidRuntime(30528):     at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:298)
08-16 22:15:52.736: ERROR/AndroidRuntime(30528):     at com.fttech.htmlParser.HtmlparserExampleActivity$1.onItemClick(HtmlparserExampleActivity.java:68)
08-16 22:15:52.736: ERROR/AndroidRuntime(30528):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)
</code></pre>

<p>EDIT: Adapter Code </p>

<pre><code>    private class GameReleaseAdapter extends ArrayAdapter&lt;GameRelease&gt; {

                //Setting the GameRelease to a single item
                private ArrayList&lt;GameRelease&gt; items;

                //Make the layout for the items
                public GameReleaseAdapter(Context context,  ArrayList&lt;GameRelease&gt; items) {
                    // TODO: make a layout for each item which you'd call (for example) itemLayout
                    super(context, R.layout.item, items);
                    this.items = items;
                }

                //Inflate the layout to override getView.
                @Override
                public View getView(int position, View convertView, ViewGroup parent) {
                    // TODO: return an item view styled however you want or as shown in the tutorial
                    View v = convertView;
                    if (v == null) {
                        LayoutInflater vi = (LayoutInflater)getSystemService(Context.LAYOUT_INFLATER_SERVICE);
                        v = vi.inflate(R.layout.row, null);

                }
                    //Setting the texts to there rightful TextViews.
                    GameRelease o = items.get(position);
                    TextView tt = (TextView) v.findViewById(R.id.toptext);
                    TextView bt = (TextView) v.findViewById(R.id.bottomtext);
                    TextView plat = (TextView)v.findViewById(R.id.platform);
                    TextView genre = (TextView)v.findViewById(R.id.genre);

                    tt.setText(o.getName());
                    bt.setText("RELEASE DATE: " +o.getReleaseDate());
                    plat.setText("PLATFORM: " + o.getPlatform());
                    genre.setText("GENRE: " + o.getGenre());

                    //Returning the View v which inflates the layout row.xml each time a item is added.
                    return v;


                }
</code></pre>

<p>EDIT: I now get this erro IndexOutOfBounds..</p>

<pre><code>08-17 00:41:10.340: ERROR/AndroidRuntime(14481): FATAL EXCEPTION: main
08-17 00:41:10.340: ERROR/AndroidRuntime(14481): java.lang.IndexOutOfBoundsException: Invalid index 39, size is 1
08-17 00:41:10.340: ERROR/AndroidRuntime(14481):     at java.util.ArrayList.throwIndexOutOfBoundsException(ArrayList.java:255)
08-17 00:41:10.340: ERROR/AndroidRuntime(14481):     at java.util.ArrayList.get(ArrayList.java:308)
08-17 00:41:10.340: ERROR/AndroidRuntime(14481):     at android.widget.ArrayAdapter.getItem(ArrayAdapter.java:341)
08-17 00:41:10.340: ERROR/AndroidRuntime(14481):     at com.fttech.htmlParser.HtmlparserExampleActivity$1.onItemClick(HtmlparserExampleActivity.java:82)
08-17 00:41:10.340: ERROR/AndroidRuntime(14481):     at android.widget.AdapterView.performItemClick(AdapterView.java:282)
</code></pre>

<p>EDIT: Here is my onItemCLick method</p>

<pre><code>this.getListView().setOnItemClickListener(new OnItemClickListener(){


                @Override
                public void onItemClick(AdapterView&lt;?&gt; parent, View view, int position, long id) {

    //The debug is pointing me to this line
GameRelease  selectedGameRelease = myGameReleaseAdapter .getItem(position);
                    String urlString = selectedGameRelease.getUrl();

                    //Make what you like with the url
                    Toast.makeText(HtmlparserExampleActivity.this, urlString, Toast.LENGTH_SHORT).show();
                    Intent i = new Intent(HtmlparserExampleActivity.this, releaseInfo.class);
                    i.putExtra("url", urlString);
                    startActivity(i);

                }
            });
                }
</code></pre>
