title: Get selected item name - Android ListView
body: <p>I have <code>ListView</code> which have items from a database.</p>
  
  <p>My adapter is this:</p>
  
  <pre><code>    Cursor cur = myDb.getCategories();
      // Closing the cursor
      // DEPRECATED!!
      startManagingCursor(cur);
  
      // Set up mapping from cursor to view fields
      String[] fromFieldNames = new String[] { DBAdapter.KEY_ITEM_CAT };
  
      int[] toViewIDs = new int[] { R.id.tvItemCat };
  
      // Create adapter to map columns of DB to elements on UI
      myCursorAdapter = new SimpleCursorAdapter(this, // Context
                  R.layout.category_layout, // Raw layout template
                  cur, // Cursor (set of DB records)
                  fromFieldNames, // DB column names
                  toViewIDs // views ID to putt in list view
      );
  
      // Set the adapter for list view
      LVCat.setAdapter(myCursorAdapter);
  </code></pre>
  
  <p><strong>getCategories():</strong></p>
  
  <pre><code>    Cursor c = db.rawQuery("SELECT DISTINCT " + KEY_ITEM_CAT + " as " + KEY_ITEM_ID
              + ", " + KEY_ITEM_CAT + " FROM " + ITEMS_TABLE_NAME, null);
  
      if (c != null) {
          c.moveToFirst();
      }
  
      return c;
  </code></pre>
  
  <p>I want when i click on some item I should get item name. 
  I've search and i found  <strong>this code:</strong></p>
  
  <pre><code>public void onCatClick(){
  
      LVCat.setOnItemClickListener(new AdapterView.OnItemClickListener() {
  
          @Override
          public void onItemClick(AdapterView&lt;?&gt; parent, View v,
                  int position, long id) {
              // TODO Auto-generated method stub
  
              String category = LVCat.getItemAtPosition(position).toString();
           // String category = parent.getItemAtPosition(position).toString(); --&gt; This also I've tried, but the same result
  
              System.out.println("Cat: " + category);
          }
      });
  }
  </code></pre>
  
  <p>For other people this works. But I don't get the item name i get something like this:
  <code>System.out(23858): Cat: android.database.sqlite.SQLiteCursor@4197f3a0</code></p>
  
  <p>So how can I get the selected item name?</p>