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:
    21
    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:
    4,167
    Joined:
    Jul 8, 2011
    Messages:
    28,042
    Likes Received:
    889
  3. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    21
    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

    Reputations:
    317,672
    Joined:
    Sep 8, 2010
    Messages:
    177,742
    Likes Received:
    59,643
    What the fuck
     
  5. Napoleon V2

    Napoleon V2 New Member Banned User

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

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    723,489
    Joined:
    Jul 6, 2011
    Messages:
    172,741
    Likes Received:
    88,092
    I got this....

    [​IMG]
     
  7. Napoleon V2

    Napoleon V2 New Member Banned User

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

    gridman Dancing Madly Backwards

    Reputations:
    83,067
    Joined:
    Sep 16, 2010
    Messages:
    31,925
    Likes Received:
    3,812
    Ya gotta jiggawatt the harmonic balancer
     
  9. ice cream

    ice cream Well-Known Member

    Reputations:
    17,405
    Joined:
    Dec 22, 2011
    Messages:
    23,103
    Likes Received:
    4,736
    someone mention kobayashi




    [​IMG]
     
  10. DarkFriday

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    723,489
    Joined:
    Jul 6, 2011
    Messages:
    172,741
    Likes Received:
    88,092
    [​IMG]

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

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    723,489
    Joined:
    Jul 6, 2011
    Messages:
    172,741
    Likes Received:
    88,092
    [​IMG]
     
  12. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    21
    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:
    133,213
    Joined:
    Jul 14, 2012
    Messages:
    31,616
    Likes Received:
    26,979
    jpeg it
     
  14. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    21
    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:
    723,489
    Joined:
    Jul 6, 2011
    Messages:
    172,741
    Likes Received:
    88,092
    [​IMG]
     
  16. Napoleon V2

    Napoleon V2 New Member Banned User

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

    DrivenByDemons Spinoff Jesus Staff Member

    Reputations:
    261,065
    Joined:
    Sep 16, 2010
    Messages:
    70,273
    Likes Received:
    42,171
    I hate sequel
     
  18. Napoleon V2

    Napoleon V2 New Member Banned User

    Reputations:
    21
    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:
    68,098
    Joined:
    Jan 30, 2011
    Messages:
    33,292
    Likes Received:
    3,741
    jpeg it

    :artiejj:
     
  20. DarkFriday

    DarkFriday Fired as a MOD...Twice. Gold

    Reputations:
    723,489
    Joined:
    Jul 6, 2011
    Messages:
    172,741
    Likes Received:
    88,092
    [​IMG]