From 62595b25530641b2d18c224caa3837b8bc46d910 Mon Sep 17 00:00:00 2001 From: afischerdev Date: Sun, 9 Jul 2023 18:35:10 +0200 Subject: [PATCH] move migration away from ui thread --- .../main/java/btools/routingapp/BRouterView.java | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java index 6e6c706..9655345 100644 --- a/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java +++ b/brouter-routing-app/src/main/java/btools/routingapp/BRouterView.java @@ -174,8 +174,18 @@ public class BRouterView extends View { // new init is done move old files if (waitingForMigration) { Log.d("BR", "path " + oldMigrationPath + " " + basedir); - if (!oldMigrationPath.equals(basedir + "/brouter")) - moveFolders(oldMigrationPath, basedir + "/brouter"); + Thread t = new Thread(new Runnable() { + @Override + public void run() { + if (!oldMigrationPath.equals(basedir + "/brouter")) + moveFolders(oldMigrationPath, basedir + "/brouter"); + }}); + t.start(); + try { + t.join(500); + } catch (InterruptedException e) { + e.printStackTrace(); + } waitingForMigration = false; }