Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to Manage Cursor After Deleting one Contact from DB

 
goel swati
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello All..

I am using custom adapter which extends simple cursor adapter in which I am overriding newvview and bindview operations.

In this I am getting from cursor from onCreate();

Initially I have 4 contacts in my DB so cursor count is 4.

But I have deleted one contact but cursor count is still 4. and my application is displaying duplicate copy of one contact at cursor position 4.

please tell me how can I manage cursor after deleting an contact from DB.

contacts details are stored in DB in table Data1.

but in Raw Contact Table, we can see one column named isDeleted. If any contact is deleted then isDeleted column contains 1 otherwise.

I think i can use it.

but I am not getting how to use it to manage cursor.


Waiting for Reply

 
Jarrek Smith
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Have you try requesting a new cursor after the delete?
like myCursor = dbhelper.getContact()
 
goel swati
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for your reply..

I have solved this problem...
I am not using DB....I am using contact database which is in ContactsContract


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic