Help with cursor!!!


Last Updated:

  1. kitty

    kitty New Member This Topic's Starter

    Joined:
    Jan 22, 2010
    Messages:
    3
    Likes Received:
    0
    Hello everyone!
    i'm trying to do with database in android.
    here is my code

    public​
    Cursor getName()
    {

    Cursor mCursor =
    db.query(true, DATABASE_TABLE, new String[] {
    KEY_ROWID,KEY_NAME},
    null,
    null,
    null,
    null,
    null,
    null);
    return mCursor;

    }

    // where i show cursor
    TextView id = (TextView) view.findViewById(android.R.id.​
    text1);

    id.setText(cursor.getString(0));

    if i just select only KEY_NAME like this (

    new String[] {KEY_NAME})my application doesnt work, its ok if i have enough KEY_ROWID,KEY_NAME .

    Anyone has problem like me please help
    thanks in advance
     

    Advertisement

Share This Page

Loading...