wood burning stoves 2.0*
The moose likes Android and the fly likes Help with SQL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Mobile » Android
Bookmark "Help with SQL" Watch "Help with SQL" New topic
Author

Help with SQL

Tyrel Richey
Greenhorn

Joined: Oct 10, 2010
Posts: 9
I hope its alright to make a new thread but the problem is different.
Alright I have been working on a chess clock of epic proportions and
almost have it up and running. But for the last and coolest part of
its functionality I have hit a wall and would appreciate some help.
The story so far:
The DatabaseHelper class can successfully add rows to the data base
which happens in an activity called add precept. I have pulled the db
file off the device and viewed it with SQLite viewer and all is well.
When I try to load one of the rows and use the data for the main
activities state things begin to go astray.
I have a method in the main activity called setClocks its a wrapper
class that uses the DatabaseHelper method getEntry to fill a MyObject
which has all the data I need to set the apps state. Please help me
figure out why a call of setClocks(1); results in an exception no row
found.
Here is the code:

If I call setClocks(1); in the onCreate of the main activity the app
crashes with the could not find row exception. I know their is a row
with an _id of 1 I can see it on my desktop. I want to load the first
precet when the app loads and then in the onCreateOptionsMenu I have
an option to select a preset. When this is selected it displays a
dialog with a spinner and 2 buttons one for loading the selected
preset and one for removing the selected preset from the database.
Here is my attempt at that. It loads the dialog and the dialog is
populated by the database but when I press load it just goes back to
the main activity with the timers as they where.

And if you need it the setTime method for a ChessClock an inner class
of the main Activity which has its own inner class CountDownTimer

Thank you for reading hope all is well.


What if every thing around you is an elaborate dream?
-Trent Reznor
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Help with SQL
 
Similar Threads
Trying to populate a spinner in a dialog with a cursor from an sql query
Help to insert/retreive image from database
problems with row position in Cursor Listview Adapter
how to create sdcard and mount on the emulator
Uncaught handler: thread main exiting due to uncaught exception