+ Logger.debug("splash", "DB init done");
+ long now = System.currentTimeMillis();
+ if (now > startupTime + keepActiveForMS)
+ startMainActivity();
+ else {
+ final long delay = keepActiveForMS - (now - startupTime);
+ Logger.debug("splash",
+ String.format(Locale.ROOT, "Scheduling main activity start in %d milliseconds",
+ delay));
+ new Handler().postDelayed(this::startMainActivity, delay);
+ }
+ }
+ private void startMainActivity() {
+ if (running) {
+ Logger.debug("splash", "still running, launching main activity");