开发者

Android Notepad Tutorial extension: getting more out of the (SQL) NotesDatabase

开发者 https://www.devze.com 2023-03-29 03:07 出处:网络
Confused beginner here. I\'m extending the functionality of the android notepad tutorial program. I can successfully get the data from the sql to display in a list view and I can use the findNote fun

Confused beginner here.

I'm extending the functionality of the android notepad tutorial program. I can successfully get the data from the sql to display in a list view and I can use the findNote function to get an individual note.

What I want to be able to do is extract an individual note AND all following notes in the table. I'd be happy with some way to iterate through the remaining notes (a puzzle for me because the rowI开发者_如何学编程ds are not sequential) but would also settle for designing a query that... I don't know, returns a String[] with the item with the matching id at position 0 and all subsequent items later in the array.

I'm sure there are a thousand ways to do this, I'm willing to take almost any of them. Please let me know if I need to clarify further.


Just looking at the NotesDbAdapter class in that tutorial, there doesn't appear to be any timestamp captured with the notes. You would need to extend the table structure to include this and update the createNote and updateNote methods to set that accordingly. Then you can write your SQL based upon that timestamp.

John

0

精彩评论

暂无评论...
验证码 换一张
取 消