]> git.ktnx.net Git - mobile-ledger.git/blobdiff - app/src/main/java/net/ktnx/mobileledger/ui/activity/SplashActivity.java
splash: show forced delay before starting the main activity in debug
[mobile-ledger.git] / app / src / main / java / net / ktnx / mobileledger / ui / activity / SplashActivity.java
index 7ab3e27937214239f06667aaab7f49b6de8ba5e5..b868366b9d94bdf1529a428cd0d5fe2147c1de90 100644 (file)
@@ -28,6 +28,8 @@ import net.ktnx.mobileledger.db.DB;
 import net.ktnx.mobileledger.utils.Logger;
 import net.ktnx.mobileledger.utils.MobileLedgerDatabase;
 
+import java.util.Locale;
+
 public class SplashActivity extends CrashReportingActivity {
     private static final long keepActiveForMS = 400;
     private long startupTime;
@@ -77,8 +79,11 @@ public class SplashActivity extends CrashReportingActivity {
         if (now > startupTime + keepActiveForMS)
             startMainActivity();
         else {
-            new Handler().postDelayed(this::startMainActivity,
-                    keepActiveForMS - (now - startupTime));
+            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() {