Hi all,

I need urgent help with a simple selection I am having difficulty
with.

I am trying to return a value of a Double called startPosition, where
trackName is equal to a name of a string.

The query doesnt seem to be returning anything, here is the code from
my DbAdapter.

Java:

    public Cursor getStartLatitude(String trackname) throws
SQLException {

        Cursor mCursor =

            mDb.query(true, DATABASE_TABLE3, new String[] {KEY_ROWID3,
KEY_TRACKNAME,
                    KEY_STARTPOSITION}, KEY_TRACKNAME + "=" +
"'kingsav'",
                    null, null, null, null, null);
    if (mCursor != null) {
        mCursor.moveToFirst();
    }
    return mCursor;

    }



And here is my code from the Java code that passes in the value and
reads it to a textview. Note above, I have used a static value for
testing purposes.


Java:
private void loadTrackInfo()
     {
          Cursor b = mDbHelper.getStartLatitude(TrackName);
     if(b.moveToFirst())
     {

          Double startLocation =
b.getDouble(b.getColumnIndex(mDbHelper.KEY_STARTPOSITION));

          selectedTracktv.setText("Active Track: "+startLocation);

     }



     }

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

To unsubscribe from this group, send email to 
android-developers+unsubscribegooglegroups.com or reply to this email with the 
words "REMOVE ME" as the subject.

Reply via email to