discrepancy in using AsyncTask, code is executed in weird order
- by Pentium10
Hello,
In onCreate method I hav the following order of code
objItem = new DbClass(this);//the onCreate event creates the database
new PrepareAdapter1().execute();//this task uses the tables, but SQLException occures, tables doesn't exists
As you see in my short code, I get a new instance of the SQLiteOpenHelper class, which does create the tables in onCreate.
And after that I start an AsyncTask instance where I use the created table.
But I get SQLiteException as table doesn't not exists.
I am using this code in wrong way? I expect the table to be created when I launch the thread.