package net.ktnx.mobileledger.ui.activity;
import android.content.Intent;
-import android.os.AsyncTask;
import android.os.Bundle;
import android.os.Handler;
startupTime = System.currentTimeMillis();
- AsyncTask<Void, Void, Void> dbInitTask = new DatabaseInitTask();
+ DatabaseInitThread dbInitThread = new DatabaseInitThread();
Logger.debug("splash", "starting dbInit task");
- dbInitTask.execute();
+ dbInitThread.start();
}
@Override
protected void onPause() {
finish();
}
}
- private static class DatabaseInitTask extends AsyncTask<Void, Void, Void> {
+ private static class DatabaseInitThread extends Thread {
@Override
- protected Void doInBackground(Void... voids) {
- long ignored = DB.get().getProfileDAO().getProfileCountSync();
+ public void run() {
+ long ignored = DB.get()
+ .getProfileDAO()
+ .getProfileCountSync();
- return null;
- }
- @Override
- protected void onPostExecute(Void aVoid) {
- Logger.debug("splash", "DatabaseInitTask::onPostExecute()");
- super.onPostExecute(aVoid);
- MobileLedgerDatabase.initComplete.setValue(true);
+ MobileLedgerDatabase.initComplete.postValue(true);
}
}
}