Android 之 SimpleCursorAdapter

Cursor cursor = db.rawQuery("select  _id,NAME"
    + "from table  ", null);

SimpleCursorAdapter adapter = new SimpleCursorAdapter(this, R.layout.activity_item,
     cursor, new String[] { "_id", "NAME" }, new int[]{ R.id.item_ID, R.id.item_Name });

 

注意:SimpleCursorAdapter中字段名要和Cursor中字段名大小写一致

posted @ 2013-10-28 14:17  阿日斯兰  阅读(161)  评论(0编辑  收藏  举报