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,802
    Likes Received:
    9
    I should mention that the ListView is inside a ListActivity
     
  2. Nantrax

    Nantrax Well-Known Member VIP Gold

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

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,802
    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:
    126,111
    Joined:
    Sep 8, 2010
    Messages:
    207,060
    Likes Received:
    95,454
    What the fuck
     
  5. Napoleon V2

    Napoleon V2 New Member Banned User

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

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    210,469
    Joined:
    Jul 6, 2011
    Messages:
    199,633
    Likes Received:
    131,827
    I got this....

    [​IMG]
     
  7. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,802
    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:
    4,004
    Joined:
    Dec 22, 2011
    Messages:
    24,645
    Likes Received:
    6,064
    someone mention kobayashi




    [​IMG]
     
  10. DarkFriday

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    210,469
    Joined:
    Jul 6, 2011
    Messages:
    199,633
    Likes Received:
    131,827
    [​IMG]

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

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    210,469
    Joined:
    Jul 6, 2011
    Messages:
    199,633
    Likes Received:
    131,827
    [​IMG]
     
  12. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,802
    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,802
    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:
    210,469
    Joined:
    Jul 6, 2011
    Messages:
    199,633
    Likes Received:
    131,827
    [​IMG]
     
  16. Napoleon V2

    Napoleon V2 New Member Banned User

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

    DrivenByDemons Spinoff Jesus Gold

    Reputations:
    14,059
    Joined:
    Sep 16, 2010
    Messages:
    72,589
    Likes Received:
    45,814
    I hate sequel
     
  18. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    0
    Joined:
    Oct 4, 2010
    Messages:
    15,802
    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,862
    Joined:
    Jan 30, 2011
    Messages:
    34,019
    Likes Received:
    4,164
    jpeg it

    :artiejj:
     
  20. DarkFriday

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    210,469
    Joined:
    Jul 6, 2011
    Messages:
    199,633
    Likes Received:
    131,827
    [​IMG]