ClassCastException in my application
<p>I am having a problem, I am trying to get the text of a listView Item using onItemClick method of the OnItemClickListener interface. The problem is the layout of the simpleCursorAdaptor has 3 TextViews, how do I get the text of only one of those TextViews? I am getting an ClassCastException. How Can I extract the contents of all the 3 textViews in the layout. Here is my code</p>

<pre><code>package com.messageHider;

import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.net.Uri;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.SimpleCursorAdapter;
import android.widget.TextView;
import android.widget.Toast;

public class sms extends Activity implements OnItemClickListener
{
ListView listViewSMS;
Uri smsUri=Uri.parse("content://sms/inbox");
Cursor cursor;
SimpleCursorAdapter adapter;

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.sms);
    listViewSMS=(ListView)findViewById(R.id.listViewSMS);
    listViewSMS.setOnItemClickListener(this);
}
@Override
protected void onStart() {
    super.onStart();
    getsms();
}
private void getsms()
{
    cursor=getContentResolver().query(smsUri,null, null, null, null);
    String[]from={"person","body","date"};
    int[]to={R.id.textViewPerson,R.id.textViewBody,R.id.textViewDate};
    adapter=new SimpleCursorAdapter(this,R.layout.smslist, cursor, from, to);
    listViewSMS.setAdapter(adapter);
}
@Override
public void onItemClick(AdapterView&lt;?&gt; parent, View v, int position, long id) {
    Toast.makeText(getApplicationContext(),((TextView) v).getText(), Toast.LENGTH_LONG).show();
    }
}
</code></pre>

<p>Here is the layout for the adaptor:</p>

<pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;LinearLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  android:layout_width="match_parent"
  android:layout_height="match_parent" android:orientation="vertical"&gt;
    &lt;LinearLayout android:layout_height="wrap_content" android:id="@+id/linearLayout1" android:layout_width="match_parent"&gt;
        &lt;TextView android:text="TextView" android:layout_height="wrap_content" android:padding="5dp" android:layout_width="wrap_content" android:id="@+id/textViewPerson"&gt;&lt;/TextView&gt;
        &lt;TextView android:text="TextView" android:layout_height="wrap_content" android:layout_width="fill_parent"  android:id="@+id/textViewDate" android:gravity="right" android:paddingRight="5dp"&gt;&lt;/TextView&gt;
    &lt;/LinearLayout&gt;
    &lt;TextView android:text="TextView" android:id="@+id/textViewBody" android:layout_height="wrap_content" android:height="60dp" android:padding="5dp" android:layout_width="fill_parent"&gt;&lt;/TextView&gt;
&lt;/LinearLayout&gt;
</code></pre>

<p>I will appreciate the help.</p>
