1
I would like to know how to do INSERT manuals in the Databasehelper class that extends from Sqliteopenhelper.
public class DatabaseHelper extends SQLiteOpenHelper {
private static final String BANCO_DADOS = "Agenda";
private static int VERSAO = 1;
public DatabaseHelper(Context context) {
super(context, BANCO_DADOS, null, VERSAO);
}
@Override
public void onCreate(SQLiteDatabase db) {
db.execSQL( "CREATE TABLE amigo (_id INTEGER PRIMARY KEY," +
" nome TEXT, telefone TEXT, " +
" email TEXT, categoria INTEGER);"
);
}
@Override
public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
}
}
What I wanted was to make Inserts within the onCreate method of the Databasehelper class just as the table was created, but I don’t know how to do.
Welcome to Stack Overflow. Try to ask one question at a time. It is better to answer and to consult later.
– Rene Freak