android - How to access one class database in another class? -
I created a database in my class like
public final string CRAZY_ALARM_DB_NAME = "CrazyDb" ; Public end string CRAZY_ALARM_TABLE_NAME = "CrazyTable"; Alarm db = this.openOrCreateDatabase (CRAZY_ALARM_DB_NAME, MODE_PRIVATE, empty); Alarm DB.XACSQL ("if not present on table" + + CRAZY_ALARM_TABLE_NAME + "(REQ_CODE INT (3), day INT (3), HOOR INT (3)" + ", minute INT (3), COUNT INT (3) , Repetition INT (3) "+", day VARCHAR2 (100), SNINT (3), Mon INT (3), "+" TEENT (3), with int (3), ThuUnt (3), FRI INT 3), "+" set INT (3));); Cr = alarmDB.rawQuery ("SELECT * FROM" + CRAZY_ALARM_TABLE_NAME, empty);
So I want to use this database in another category. I am also doing the same thing, I wrote the code "OpenOffrrr" in another class and in the "cursor". But while compiling it on the cursor line ... there was no such table.
Please help me
The better you can, it's a database assistant, where you can make all these calls And which can be available and accessible from all your activities.
In addition to this, you should remove and install your app again to be able to create a table. I have this problem at any time.
Comments
Post a Comment