how do you delete an item from an SQLiteDatabase from a ContextMenu on a ListView?

Discussion in 'The Bar' started by Napoleon V2, Aug 7, 2013.

  1. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,803
    Likes Received:
    9
    I should mention that the ListView is inside a ListActivity
     
  2. Nantrax

    Nantrax Well-Known Member VIP Gold

    Reputations:
    0
    Joined:
    Jul 8, 2011
    Messages:
    28,041
    Likes Received:
    889
  3. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,803
    Likes Received:
    9
    They are removed from the listview by when OnCreate is called again the "deleted" items are loaded from the DB
     
  4. Mark Mayonnaise

    Mark Mayonnaise You look like a tree! VIP Gold

    Reputations:
    67,043
    Joined:
    Sep 8, 2010
    Messages:
    195,680
    Likes Received:
    80,573
    What the fuck
     
  5. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,803
    Likes Received:
    9
    pls help
     
  6. DarkFriday

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    95,513
    Joined:
    Jul 6, 2011
    Messages:
    189,075
    Likes Received:
    113,752
    I got this....

    [​IMG]
     
  7. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,803
    Likes Received:
    9
    uhhh
     
  8. gridman

    gridman Dancing Madly Backwards

    Reputations:
    15
    Joined:
    Sep 16, 2010
    Messages:
    31,929
    Likes Received:
    3,818
    Ya gotta jiggawatt the harmonic balancer
     
  9. ice cream

    ice cream Well-Known Member VIP

    Reputations:
    2,123
    Joined:
    Dec 22, 2011
    Messages:
    24,242
    Likes Received:
    5,637
    someone mention kobayashi




    [​IMG]
     
  10. DarkFriday

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    95,513
    Joined:
    Jul 6, 2011
    Messages:
    189,075
    Likes Received:
    113,752
    [​IMG]

    Put X in the center square...
     
  11. DarkFriday

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    95,513
    Joined:
    Jul 6, 2011
    Messages:
    189,075
    Likes Received:
    113,752
    [​IMG]
     
  12. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,803
    Likes Received:
    9
    I'm working on a new project
    this one has way more money making potential than my j/o counter
     
  13. Gitfiddle

    Gitfiddle Live Deliciously

    Reputations:
    9
    Joined:
    Jul 14, 2012
    Messages:
    31,614
    Likes Received:
    26,997
    jpeg it
     
  14. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,803
    Likes Received:
    9
    i've tried an execSQL command and it returns no errors but doesn't seem to work
     
  15. DarkFriday

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    95,513
    Joined:
    Jul 6, 2011
    Messages:
    189,075
    Likes Received:
    113,752
    [​IMG]
     
  16. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,803
    Likes Received:
    9
    SQL looks like that to me
     
  17. DrivenByDemons

    DrivenByDemons Spinoff Jesus Staff Member

    Reputations:
    6,211
    Joined:
    Sep 16, 2010
    Messages:
    71,534
    Likes Received:
    44,198
    I hate sequel
     
  18. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,803
    Likes Received:
    9
    NVM figured it out
    by using a toast window I was able to see what was passing to my delete method
    what I thought was the position of the ListView item was actually the data displayed by the ListView item
    a quick update of the execSQL statement and the program is now doing what I want it to
     
  19. Gas Face

    Gas Face Well-Known Member

    Reputations:
    1,844
    Joined:
    Jan 30, 2011
    Messages:
    34,012
    Likes Received:
    4,158
    jpeg it

    :artiejj:
     
  20. DarkFriday

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    95,513
    Joined:
    Jul 6, 2011
    Messages:
    189,075
    Likes Received:
    113,752
    [​IMG]