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

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -