ListArray and List View, populating a list from a parser
<p>I am trying to write a parser that parses out HTML times for bus routes. 
But im having a problem getting the list to show up with a while loop.
I if use</p>

<pre><code>Content = extractor.BusRoutes.get(0);
Content = extractor.BusRoutes.get(1);
</code></pre>

<p>I can get them to show up in a list by using a text view in android, but I want a list. </p>

<p>I can get a list if i go</p>

<pre><code>setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, busroutearray));
</code></pre>

<p>But thats if i have an XML already populated with the items, which i cant use easily. </p>

<p>the loop i am doing now is </p>

<pre><code>public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);



    ArrayList&lt;String&gt; busroutearray = new ArrayList&lt;String&gt;();

    int x = 0;
    while(x &gt; 37){
        busroutearray.add(x, extractor.BusRoutes.get(x));
    x++;
    }

setListAdapter(new ArrayAdapter&lt;String&gt;(this, android.R.layout.simple_list_item_1, busroutearray));
</code></pre>

<p>I can not figure out why it wont display, is there a better way to do this? the "x" is the spot in the array from 0 to 37.</p>

<p>Here is the LogCat</p>

<pre><code>02-08 16:45:27.222: D/dalvikvm(1882): GC_EXTERNAL_ALLOC freed 52K, 54% free 2487K/5379K, external 1596K/2108K, paused 46ms
02-08 16:45:32.320: D/AndroidRuntime(1882): Shutting down VM
02-08 16:45:32.320: W/dalvikvm(1882): threadid=1: thread exiting with uncaught exception (group=0x40015578)
02-08 16:45:32.324: E/AndroidRuntime(1882): FATAL EXCEPTION: main
02-08 16:45:32.324: E/AndroidRuntime(1882): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.taylordev.nextstop/com.taylordev.nextstop.BusRoutes}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.os.Handler.dispatchMessage(Handler.java:99)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.os.Looper.loop(Looper.java:123)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.app.ActivityThread.main(ActivityThread.java:3687)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at java.lang.reflect.Method.invokeNative(Native Method)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at java.lang.reflect.Method.invoke(Method.java:507)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at dalvik.system.NativeStart.main(Native Method)
02-08 16:45:32.324: E/AndroidRuntime(1882): Caused by: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list'
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.app.ListActivity.onContentChanged(ListActivity.java:243)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:212)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.app.Activity.setContentView(Activity.java:1657)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at com.taylordev.nextstop.BusRoutes.onCreate(BusRoutes.java:50)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
02-08 16:45:32.324: E/AndroidRuntime(1882):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
02-08 16:45:32.324: E/AndroidRuntime(1882):     ... 11 more
</code></pre>
