Inserting rows into table only once in Android Database -
i want insert 10 rows table @ database creation. not want them added every time app open. once table final values. how go doing this? thanks!
public void insertevents(){ sqlitedatabase db = this.getwritabledatabase(); contentvalues values = new contentvalues(); values.put(col_event, "value1"); values.put(col_event, "value2"); values.put(col_event, "value3"); values.put(col_event, "value4"); db.insert(table_events, null, values); }
do in oncreate
method of databasehelper
edit: here similar question. or can try this tutorial
Comments
Post a Comment