• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

How to Manage Cursor After Deleting one Contact from DB

 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic