Location Listing problem
<p>I am experimenting with locations and listviews. I am getting location results back and I am trying to create a listview of my locations results using the following code:</p>

<p>ListView locationList           =   (ListView)findViewById(R.id.ListView01);
            String[] items = new String[]{};</p>

<pre><code>        try {
            Geocoder geocoder       =   new Geocoder(this, Locale.getDefault());
            List&lt;Address&gt; addresses =   geocoder.getFromLocation(LATITUDE, LONGITUDE, 5);
            address_textview.setText( ""+addresses );

            Address[] addresses_array       =   new Address[addresses.size()];
            addresses.toArray(addresses_array);

            for( int i = 0; i &lt; addresses_array.length; i++ ){
                items[i]    =   addresses_array[i].getPostalCode();
            }

        } catch (IOException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }

        ArrayAdapter&lt;String&gt; adapter    =   new ArrayAdapter&lt;String&gt;(this, R.layout.list_item, items);
        locationList.setAdapter(adapter);
</code></pre>

<p>My problem is, when I try to write into my items array ( items[i]   =   addresses_array[i].getPostalCode(); )  in the forloop, my application crashes.</p>

<p>Can anyone please help. I am stuck at this point.</p>
