During onCreate() I’m trying to insert about 20 rows into the SQLite database (these are just test values. For the final version I’ll have to insert about 1000).
Using the debugger it appears that when running onCreate() this causes a “Activity pause timeout for HistoryRecord”, and it seems from the log not all rows are inserted.
Is using an asyncronous task the only way to make this work without the timeout?
Thanks
Yes asyncronous task or in a separate Thread is the right way, additionally you can tell the db that you are starting a transaction which speeds up the process significantly for large inserts,
dh.getDb().beginTransaction();
//insert statemetns
dh.getDb().setTransactionSuccessful();
dh.getDb().endTransaction();