Hello guys,
I tried to create database on click button and still not able to create.
- - - - - - - - - - - - - -- - - - - - -- - - - - - -- - - - - - -- - - - - - -- - - - - - -
super.onCreate(savedInstanceState);
SQLiteDatabase myDB= null;
String TableName = "contact";
myDB = this.openOrCreateDatabase("DatabaseName", MODE_PRIVATE, null);
myDB.execSQL("CREATE TABLE IF NOT EXISTS "
+ TableName + " (ID VARCHAR(10), Name VARCHAR(100));");
- - - - - - - - - - - - - -- - - - - - -- - - - - - -- - - - - - -- - - - - - -- - - - - - -
if I write code below at " super.onCreate(savedInstanceState); ". There is no error occur.
if I try to place those code under a function or method, the error occur
what should I have to do to fix the error?
I tried to create database on click button and still not able to create.
- - - - - - - - - - - - - -- - - - - - -- - - - - - -- - - - - - -- - - - - - -- - - - - - -
super.onCreate(savedInstanceState);
SQLiteDatabase myDB= null;
String TableName = "contact";
myDB = this.openOrCreateDatabase("DatabaseName", MODE_PRIVATE, null);
myDB.execSQL("CREATE TABLE IF NOT EXISTS "
+ TableName + " (ID VARCHAR(10), Name VARCHAR(100));");
- - - - - - - - - - - - - -- - - - - - -- - - - - - -- - - - - - -- - - - - - -- - - - - - -
if I write code below at " super.onCreate(savedInstanceState); ". There is no error occur.
if I try to place those code under a function or method, the error occur
what should I have to do to fix the error?