0
My project has a Textview that should already start displaying a value to the user, this will only have to change it. But, this value is not being displayed. I believe it is not being saved. How do I insert this initial value into the table?
This is the code I’m using and it doesn’t work:
public void onCreate(SQLiteDatabase bd) {
bd.execSQL("create table dados(_id integer primary key autoincrement, data text not null);");
String sql = "INSERT INTO dados (data) values('DD/MM/AAAA')";
bd.execSQL(sql);
}
What’s not working out?
– ramaral
I want when the program is first started by the user, a date already appears for the user so that he can only edit it later. But this initial date I’m trying to put up is not recording in the bank.
– Mara Oliveira
And while this date is not changed by the user, the one that was initially entered remains.
– Mara Oliveira
It has how to check whether the method
onCreateis being called? At the same time, it could include the code that retrieves the BD record and theSQLiteOpenHelper?– Wakim