simpleCursorAdapter中的listview获取内容

class ListListener implements android.widget.AdapterView.OnItemClickListener{

  @Override
  public void onItemClick(AdapterView parent, View view, int position,
    long id) {
   // TODO Auto-generated method stub
    ListView listView = (ListView) parent; 
    Cursor cursor = (Cursor) listView.getItemAtPosition(position); 
    String personid=cursor.getString(cursor.getColumnIndex("name"));
    Toast.makeText(getApplicationContext(), personid, 1).show(); 

  }
  
 }

你可能感兴趣的:(Android开发)