title: Why does my program crash after I add Listview? Android
body: <p>I am attempting to connect a listview lv to its id using </p>
  
  <pre><code>        ListView lv = (ListView) findViewById(R.id.ImTrackingListView);
  </code></pre>
  
  <p>However whenever it hits this step my program crashes and sends it to the Source not found page. 
  Here is my code</p>
  
  <pre><code>public class ImTracking extends Activity {
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          // TODO Auto-generated method stub
          super.onCreate(savedInstanceState);
          setContentView(R.layout.imtrackinglayout);
          ListView lv = (ListView) findViewById(R.id.imtrackinglistview);
  </code></pre>
  
  <p>I checked to make sure that there wasn't another id with the same name. Hopefully someone can help me find out why this is happening.</p>
  
  <p>edit here is the xml (I changed the id to lowercase)</p>
  
  <pre><code> &lt;?xml version="1.0" encoding="utf-8"?&gt;
   &lt;LinearLayout
     xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"&gt;
  
  
   &lt;ListView   android:layout_width="fill_parent"
  android:layout_height="fill_parent" android:id="@+id/imtrackinglistview"&gt;&lt;/ListView&gt;
  
   &lt;/LinearLayout&gt;
  </code></pre>
  
  <p>Here is my logcat response</p>
  
  <pre><code>08-09 20:19:12.335: WARN/System.err(640): java.lang.ClassCastException:     android.widget.TextView
   08-09 20:19:12.354: WARN/System.err(640):     at   com.cellphone.ImTracking.onCreate(ImTracking.java:30)
   08-09 20:19:12.366: WARN/System.err(640):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
   08-09 20:19:12.366: WARN/System.err(640):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1586)
   08-09 20:19:12.374: WARN/System.err(640):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1638)
   08-09 20:19:12.374: WARN/System.err(640):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
   08-09 20:19:12.374: WARN/System.err(640):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:928)
   08-09 20:19:12.384: WARN/System.err(640):     at      android.os.Handler.dispatchMessage(Handler.java:99)
   08-09 20:19:12.384: WARN/System.err(640):     at android.os.Looper.loop(Looper.java:123)
   08-09 20:19:12.394: WARN/System.err(640):     at android.app.ActivityThread.main(ActivityThread.java:3647)
   08-09 20:19:12.394: WARN/System.err(640):     at java.lang.reflect.Method.invokeNative(Native Method)
   08-09 20:19:12.394: WARN/System.err(640):     at java.lang.reflect.Method.invoke(Method.java:507)
   08-09 20:19:12.404: WARN/System.err(640):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
   08-09 20:19:12.404: WARN/System.err(640):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
   08-09 20:19:12.404: WARN/System.err(640):     at dalvik.system.NativeStart.main(Native Method)
   08-09 20:19:16.847: WARN/ActivityManager(60): Launch timeout has expired, giving up wake lock!
   08-09 20:19:16.987: WARN/ActivityManager(60): Activity idle timeout for HistoryRecord{408bf110 com.cellphone/.ImTracking}
  </code></pre>