Increement issue in android -


i want increase value of "unit" in question

public void fetchunit() { carddatabase carddb =new carddatabase(getapplicationcontext()); carddb.open(); cursor c=carddb.selectall(); // c.movetofirst(); c.movetofirst(); int count = c.getcount(); log.e("card", c.getstring(0)); inflaterecord(c.getstring(0),c.getstring(1)); c.movetonext(); unit=c.getstring(0); c.close(); carddb.close(); } int count; public void getunit() { carddatabase carddb =new carddatabase(getapplicationcontext()); carddb.open(); cursor c=carddb.getrecord(unit); // c.movetofirst(); // c.movetofirst(); count = c.getcount(); log.e("card", c.getstring(0)); inflaterecord(c.getstring(0),c.getstring(1)); c.movetonext(); c.close(); carddb.close(); } 

when call getunit() there no incremeant in "unit"....so give same value when call getunit()

public void bottom2top(view v) { // todo auto-generated method stub switch(v.getid()){ case r.id.img3: getunit(); break; } } 

pleas suggest me do...thank all

when close cursor using c.close() lose information position of cursor.

you should either:

  • retreive specific record using primary key

or

  • retrieve records , return them arraylist

Comments

Popular posts from this blog

javascript - backbone.js Collection.add() doesn't `construct` (`initialize`) an object -

php - Get uncommon values from two or more arrays -

Adding duplicate array rows in Php -