I'd like to create a kind of virtual book where I can scroll through the pages by left or right swipe gesture (or first by just using "next" and "previous" - buttons). The content of a book page is loaded from a sqlite-database (for each page I'll use a separate database entry).

My Questions:

  • Is there any special list activity I can use for that?

  • Can someone post an example code snippet?

有帮助吗?

解决方案 2

A ViewPager is the right solution ... a FragmentPagerAdapter has to serve it the sqlite content.

Here is a link to the developer training site

其他提示

I would first look at the android SDK sample MultiRes, this will give you an idea of how to do at least a next. I would then look at Android Listview Example

Then you'll have to figure out the logic on putting them together. That's the fun of android development. If your still stuck you can start looking for code samples i.e github or code.google.com, etc.

Hope this helps.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top