I am getting an error when click on the listview, I have pasted the code
<p>Inside the onclick event I want the position of the list selected in Integer, but I am getting error.</p>

<p>This is the code I have written in my onclick event</p>

<pre><code>Integer item = (Integer) getListAdapter().getItem(position);
</code></pre>

<p>This is the error I am getting so can any one help me out tos ort whats wrong. </p>

<p>I have a class call Searcpage wch consists of simple listview</p>

<pre><code>12-01 04:59:07.759: ERROR/AndroidRuntime(405): FATAL EXCEPTION: main
12-01 04:59:07.759: ERROR/AndroidRuntime(405): java.lang.ClassCastException: java.lang.String
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at     com.search.SearchPage.onListItemClick(SearchPage.java:73)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at android.app.ListActivity$2.onItemClick(ListActivity.java:321)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at android.widget.AdapterView.performItemClick(AdapterView.java:284)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at android.widget.ListView.performItemClick(ListView.java:3382)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at android.widget.AbsListView$PerformClick.run(AbsListView.java:1696)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at android.os.Handler.handleCallback(Handler.java:587)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at android.os.Handler.dispatchMessage(Handler.java:92)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at android.os.Looper.loop(Looper.java:123)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at android.app.ActivityThread.main(ActivityThread.java:4627)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at java.lang.reflect.Method.invokeNative(Native Method)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at java.lang.reflect.Method.invoke(Method.java:521)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
12-01 04:59:07.759: ERROR/AndroidRuntime(405):     at dalvik.system.NativeStart.main(Native Method)
</code></pre>
