Skip to content

Tag: android-sqlite

Send spinner data to database

I am trying to send data to database from a spinner I initialize the database like this SPINNER + ” TYPE “; And in insert data method I put it as Type spinner but this line gives me an error contentValues.put(SPINNER, spinner); what should I put there instead of put Answer You are trying to save a…

Unable to migrate android sqllite database

I have been running the onUpgrade method without issues, until this column: I have updated the database version. The above has been simplified to try and make sure that nothing else is causing this column to not be created. Note that if I uninstall the app and reinstall the app, then it runs without issue. Ho…

SQLite: select from column by month

I am trying to sum a tablecolumn on basis of month but I got the following exception: the function the table In the debugger the cursor contains one item but when calling getInt(..) the app crashes Answer The column created for this result: is not called Total. Change the sql statement to this: This way you g…