1. Check out our companion app, Forums for Android! Download from Google Play

Help with cursor!!!

Discussion in 'Application Development' started by kitty, Feb 9, 2010.

  1. kitty

    kitty New Member
    Thread Starter
    5

    Jan 22, 2010
    3
    0
    5
    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...