handler.postdelayed(r, 30000) を介してランナブル内で実行される asynctask 内でいくつかの DB を実行します。それが繰り返されます (ご覧のとおり、30 秒ごと)。
毎回ではありませんが、アプリがクラッシュすることがあります。以下はlogcatです。
09-24 18:28:52.813: W/dalvikvm(6194): threadid=12: thread exiting with uncaught exception (group=0x40daf1f8)
09-24 18:28:52.823: E/AndroidRuntime(6194): FATAL EXCEPTION: AsyncTask #2
09-24 18:28:52.823: E/AndroidRuntime(6194): java.lang.RuntimeException: An error occured while executing doInBackground()
09-24 18:28:52.823: E/AndroidRuntime(6194): at android.os.AsyncTask$3.done(AsyncTask.java:278)
09-24 18:28:52.823: E/AndroidRuntime(6194): at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
09-24 18:28:52.823: E/AndroidRuntime(6194): at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
09-24 18:28:52.823: E/AndroidRuntime(6194): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
09-24 18:28:52.823: E/AndroidRuntime(6194): at java.util.concurrent.FutureTask.run(FutureTask.java:137)
09-24 18:28:52.823: E/AndroidRuntime(6194): at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:208)
09-24 18:28:52.823: E/AndroidRuntime(6194): at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1076)
09-24 18:28:52.823: E/AndroidRuntime(6194): at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:569)
09-24 18:28:52.823: E/AndroidRuntime(6194): at java.lang.Thread.run(Thread.java:856)
09-24 18:28:52.823: E/AndroidRuntime(6194): Caused by: java.lang.IllegalStateException: database /data/data/com.myApp/databases/mydb.db (conn# 0) already closed
09-24 18:28:52.823: E/AndroidRuntime(6194): at android.database.sqlite.SQLiteDatabase.verifyDbIsOpen(SQLiteDatabase.java:2100)
09-24 18:28:52.823: E/AndroidRuntime(6194): at android.database.sqlite.SQLiteDatabase.lock(SQLiteDatabase.java:418)
09-24 18:28:52.823: E/AndroidRuntime(6194): at android.database.sqlite.SQLiteDatabase.lock(SQLiteDatabase.java:405)
09-24 18:28:52.823: E/AndroidRuntime(6194): at android.database.sqlite.SQLiteQuery.fillWindow(SQLiteQuery.java:79)
09-24 18:28:52.823: E/AndroidRuntime(6194): at android.database.sqlite.SQLiteCursor.fillWindow(SQLiteCursor.java:164)
09-24 18:28:52.823: E/AndroidRuntime(6194): at android.database.sqlite.SQLiteCursor.getCount(SQLiteCursor.java:156)
09-24 18:28:52.823: E/AndroidRuntime(6194): at com.myApp.DbAllHelper.dbMethod1(DbAllHelper.java:273)
09-24 18:28:52.823: E/AndroidRuntime(6194): at com.myApp.DbAllHelper.dbMethod2(DbAllHelper.java:582)
09-24 18:28:52.823: E/AndroidRuntime(6194): at com.myApp.MainActivity$checkToInternetOnly.doInBackground(MainActivity.java:278)
09-24 18:28:52.823: E/AndroidRuntime(6194): at com.myApp.MainActivity$checkToInternetOnly.doInBackground(MainActivity.java:1)
09-24 18:28:52.823: E/AndroidRuntime(6194): at android.os.AsyncTask$2.call(AsyncTask.java:264)
09-24 18:28:52.823: E/AndroidRuntime(6194): at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)