Skip to content
Advertisement

Tag: 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 spinner object in

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. How would I go about

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 give the name (alias)

Why don’t my data insert into SQLite database on android?

I’m creating a simple todo list. So, I have activity (NewTaskActivity) Xml code: And I have a class NewTaskActivity.java: In this class(NewTaskActivity.java) I want to add data in database. Database class (DBHelper.java): And my data don’t insert into database. Why? I checked for data in NewTaskActivity.java using Log.d() after ‘insert’ and before ‘finish’ but they got me nothing. I’ve done

Advertisement