android - How to retrieve data from the database in the View Pager concept? -


i have implemented view pager concept , retrieved 1 data. now,i want retrieve other data data base pages swipe to..

xyz= db.tablename(id); (int = 0; < xyz.size(); i++)  { data1 key= xyz.get(i).get("data1");     data2 key=xyz.get(i).get("data2");     data3 key=xyz.get(i).get("data3"); } 

now these values on 1 screen , being repeated other swiped views.

whereas,i want values change other layouts of swipe views.

i have declared view pager coding after setting text particular field.

my view pager coding this..

pageadapter adapter=new pageadapter(); vp.setadapter(adapter); vp.setcurrentitem(0); 

what should do?

i tried implementing view pager coding(above mentioned coding) within loop neither content layout seen nor swipe features work.

if using fragments viewpager in fragment class make cursor statment id id of viewpager. , populate listview cursor. way database entries sorted according id of viewpager. make column in database named viewpagerid or if need.

the raw query can like

select * tbl_name viewpagerid = ?

where ? can viewpager id.


Comments

Popular posts from this blog

c++ - llvm function pass ReplaceInstWithInst malloc -

java.lang.NoClassDefFoundError When Creating New Android Project -

Decoding a Python 2 `tempfile` with python-future -