开发者

How to feed data to PagerAdapter

I am using this example to use a ViewPager and a PagerAdapter. But how could I feed the PagerAdapter with data from a adapter like CursorAdapter where I load the data using a CursorLoader?

The .setAdapter() on the ViewPager only takes a PagerAdapter. Then I would guess I need to bind the CursorAdapter within开发者_JS百科 the PagerAdapter, but I could not find a way doing this.


Here's a blog post where I offer the source code for a CursorPagerAdapter which does what you appear to want.


You don't need the CursorAdapter, just use the Cursor to populate the views in the PagerAdapter.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜