title: onclick action doesnt perform properly in listview
body: <p>I used a listview in a android app. Each row of listview is consisted with  two textviews,one textview(named <code>text1</code>) to show a word from the database and another textview(named <code>text2</code>) for showing the meaning of that word from the database.Showing of listview worked fine. I wanted to show the word and the meaning from the listview whenever i clicked on a row(item)of a listview. But this actions doesn't work well, it's getting 'forced close' .
  I used this code:</p>
  
  <pre><code>@Override
          public void afterTextChanged(Editable s) {
  
              mDbHelper.open();
  
              String ss=s.toString();// get the word from the edittext 
  
               ArrayList&lt;HashMap&lt;String, String&gt;&gt; list_of_wordmeanings = new ArrayList&lt;HashMap&lt;String, String&gt;&gt;();
  
              Cursor mCursor = mDbHelper.getTestData(ss);// get the rows from the database matched with EditText data
  
              for (int i = 0; i &lt; mCursor.getCount(); i++) 
              {
                  mCursor.moveToPosition(i);
  
  
                  HashMap&lt;String, String&gt; hm = new HashMap&lt;String, String&gt;();
  
                      String word = mCursor.getString(0).toString();
                      String meaning = mCursor.getString(1).toString();
  
                        hm.put("key_word",word);
                        hm.put("key_meaning",meaning);
  
                        list_of_wordmeanings.add(hm);
              }
  
                      String[] from = { "key_word","key_meaning" };
                      int[] to = { R.id.txt1,R.id.txt2};
                      SimpleAdapter adapter = new SimpleAdapter(getBaseContext(), list_of_wordmeanings, R.layout.list_layout, from, to);
  
                      listView.setAdapter(adapter);
              } // end of afterTextChanged
  
          listView.setOnItemClickListener(new OnItemClickListener() {
  
                            @Override
                            public void onItemClick(AdapterView&lt;?&gt; parent, View view,
                               int position, long id) {
  
                                Cursor cursor = (Cursor) listView.getItemAtPosition(position);
  
  
                                 String english_word =
                                  cursor.getString(0);
                                 String word_meaning =
                                          cursor.getString(1);
  
                                 Toast.makeText(getApplicationContext(),english_word+word_meaning, Toast.LENGTH_SHORT).show();
    }
  </code></pre>
  
  <p>My LogCat shows these:</p>
  
  <pre><code>08-05 10:34:13.470: W/KeyCharacterMap(15079): No keyboard for id 0
  08-05 10:34:13.470: W/KeyCharacterMap(15079): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
  08-05 10:34:15.150: W/dalvikvm(15079): threadid=1: thread exiting with uncaught exception (group=0x40015560)
  08-05 10:34:15.159: E/AndroidRuntime(15079): FATAL EXCEPTION: main
  08-05 10:34:15.159: E/AndroidRuntime(15079): java.lang.ClassCastException: java.util.HashMap
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at com.example.chondrokotha5.MainActivity$2.onItemClick(MainActivity.java:136)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at android.widget.AdapterView.performItemClick(AdapterView.java:284)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at android.widget.ListView.performItemClick(ListView.java:3513)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at android.os.Handler.handleCallback(Handler.java:587)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at android.os.Handler.dispatchMessage(Handler.java:92)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at android.os.Looper.loop(Looper.java:123)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at android.app.ActivityThread.main(ActivityThread.java:3683)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at java.lang.reflect.Method.invokeNative(Native Method)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at java.lang.reflect.Method.invoke(Method.java:507)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
  08-05 10:34:15.159: E/AndroidRuntime(15079):    at dalvik.system.NativeStart.main(Native Method)
  08-05 10:35:13.449: W/KeyCharacterMap(15090): No keyboard for id 0
  08-05 10:35:13.449: W/KeyCharacterMap(15090): Using default keymap: /system/usr/keychars/qwerty.kcm.bin
  08-05 10:35:16.250: W/dalvikvm(15090): threadid=1: thread exiting with uncaught exception (group=0x40015560)
  08-05 10:35:16.260: E/AndroidRuntime(15090): FATAL EXCEPTION: main
  08-05 10:35:16.260: E/AndroidRuntime(15090): java.lang.ClassCastException:  java.util.HashMap
  08-05 10:35:16.260: E/AndroidRuntime(15090):    at com.example.chondrokotha5.MainActivity$2.onItemClick(MainActivity.java:136)
  08-05 10:35:16.260: E/AndroidRuntime(15090):    at android.widget.AdapterView.performItemClick(AdapterView.java:284)
  08-05 10:35:16.260: E/AndroidRuntime(15090):    at android.widget.ListView.performItemClick(ListView.java:3513)
  08-05 10:35:16.260: E/AndroidRuntime(15090):    at android.widget.AbsListView$PerformClick.run(AbsListView.java:1812)
  08-05 10:35:16.260: E/AndroidRuntime(15090):    at android.os.Handler.handleCallback(Handler.java:587)
  08-05 10:35:16.260: E/AndroidRuntime(15090):    at android.os.Handler.dispatchMessage(Handler.java:92)
  08-05 10:35:16.260: E/AndroidRuntime(15090):    at android.os.Looper.loop(Looper.java:123)
   08-05 10:35:16.260: E/AndroidRuntime(15090):   at android.app.ActivityThread.main(ActivityThread.java:3683)
   08-05 10:35:16.260: E/AndroidRuntime(15090):   at java.lang.reflect.Method.invokeNative(Native Method)
  08-05 10:35:16.260: E/AndroidRuntime(15090):    at java.lang.reflect.Method.invoke(Method.java:507)
   08-05 10:35:16.260: E/AndroidRuntime(15090):   at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:839)
   08-05 10:35:16.260: E/AndroidRuntime(15090):   at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
   08-05 10:35:16.260: E/AndroidRuntime(15090):   at dalvik.system.NativeStart.main(Native Method)
  </code></pre>
  
  <p>What should i do to show the string of two rextview in from the listview ??
  Please anyone tell me what i am doing wrong and whatz the solution????</p>