Wednesday, August 3, 2011

[android-developers] Re: Problem getting string from database

When I tried again on the second post instead I get row number 1. So
the first post is 0 and the second is 1. So when I read the second one
I get the info from the first post.
I use this from a context menu to get the row:

AdapterContextMenuInfo info = (AdapterContextMenuInfo)
item.getMenuInfo();
switch(item.getItemId()) {
case DELETE_ID:
mDbHelper.deleteTask(info.id);
fillData();
return true;
case EDIT_ID:
long l = info.id;
addDaily(info.id);
return true;
}

Adding +1 after info.id feels wrong. Is there a better way to do this
more exact you think?

André

On Aug 3, 4:07 pm, Kostya Vasilyev <kmans...@gmail.com> wrote:
> Bingo.
>
> Cursor data is organized into rows and columns.
>
> If there are zero rows, you won't be able to get any data, and it's in
> fact an error to try - as you'd be asking for data from row 0 out of 0 -
> exactly as the exception error message says.
>
> -- Kostya
>
> 03.08.2011 17:23, André пишет:
>
> > Thanks for the quick reply.
> > It says that there is 0 rows when using get count. Is it a problem
> > with the row number I provide it you think?
>
> > André
>
> --
> Kostya Vasilyev

--
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+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate