![]() ![]() ![]() Public class MainActivity extends FragmentActivity ![]() SQLiteDatabase db= void onCreate(SQLiteDatabase db)ĭb.execSQL("create table" + TABLE_NAME+"(QUESTION_NO INTEGER PRIMARY KEY AUTOINCREMENT,QUESTION_ANS void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion)ĭb.execSQL("DROP TABLE IF EXISTS"+TABLE_NAME) Īnd this is mainactivity.java package 1 ![]() Public static final String COL_2="QUESTION_ANS" Public static final String COL_1="QUESTION_NO" Public static final String TABLE_NAME="answers_table" Public static final String DATABASE_NAME="Answers.db" Public class Databasehelper extends SQLiteOpenHelper I have created a Databasehelper.java class and in that class I have called SQLite database class and implemented all its methods and in the main class when I am calling this class instance and when I am running the app It is showing "Unfortunately your app has stopped" ![]()
0 Comments
Leave a Reply. |