I have activity to initialize a game that performs multiple fetch and paste from multiple SQLite tables.
I am trying to understand AsyncTask, but from all the examples that I have read so far, I am wondering if I need to subclass AsyncTask for every single data operation that I need to do?
For example, my activity in NewGame does the following:
1) Insert new player record into PLAYER table 2) Insert new player pet record into PET table 3) Select cursor of n records from INVENTORY 4) Insert array of ranomly chosen inventory items into PLAYER_OWNED table 5) ....more things of a similar nature
There will be several more selections and inserts for different things, so having a separate subclass for each of them will be crazy. Not to mention that in this game there will be about 8 events, which largely depend on reading and writing the database.
So basically, what is the best way to use AsyncTask to perform several different SQLite operations?
source share