Note that there are some explanatory texts on larger screens.

plurals
  1. POsqlite force close after opening database
    text
    copied!<p>My databases (information to display on a table) are connected to buttons. When they are clicked, the table should show info. The database works, but this is the catcher: It works when I had info already entered from testing. But the database crashes if their is nothing to load. Here is the code:</p> <pre><code>rentD.open(); Log.d(TAG, "OPENING RENT DATABASE..."); String rentData = rentD.getData(); billAmount.setText("Total: " + nf.format(rentD.getAmountTotal())); Log.d(TAG, "CLOSING RENT DATABASE..."); rentD.close(); Log.d(TAG, "RENT DATABASE CLOSED"); dataResults.setText(rentData); </code></pre> <p>So every time I click the RENT button, I get a forced close. After further looking, The problem I found have to do with:</p> <pre><code>billAmount... nf.format(rentD.getAmountTotal())); </code></pre> <p>which displays a the amount in money format. So if I replace "rentD.getAmountTotal()" with a String variable, the database works perfectly. Here is the error I recieved from LogCat:</p> <pre><code>10-26 23:53:40.764: DEBUG/DEBUG(14999): OPENING RENT DATABASE... 10-26 23:53:40.764: DEBUG/AndroidRuntime(14999): Shutting down VM 10-26 23:53:40.764: WARN/dalvikvm(14999): threadid=1: thread exiting with uncaught exception (group=0x4001d5a0) </code></pre> <p>Again, the problem seems to be passing data that doesn't exist yet into the textview. My end result is to have the program start with no data in it so the user can get to the activities that will populate the table. Any suggestions?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload