From 2f9af2e1f1a52fcd5914cbc3cee640ba350f096f Mon Sep 17 00:00:00 2001 From: "Daniele Verducci (Slimpenguin)" Date: Fri, 13 May 2022 08:54:38 +0200 Subject: [PATCH] Fixed #11 --- .../java/it/danieleverducci/ojo/ui/MainActivity.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/it/danieleverducci/ojo/ui/MainActivity.java b/app/src/main/java/it/danieleverducci/ojo/ui/MainActivity.java index dedddc1..f0df45c 100644 --- a/app/src/main/java/it/danieleverducci/ojo/ui/MainActivity.java +++ b/app/src/main/java/it/danieleverducci/ojo/ui/MainActivity.java @@ -72,10 +72,14 @@ public class MainActivity extends AppCompatActivity { return; } - if (bundle != null) - navController.navigate(actionId, bundle); - else - navController.navigate(actionId); + try { + if (bundle != null) + navController.navigate(actionId, bundle); + else + navController.navigate(actionId); + } catch (IllegalArgumentException e) { + Log.e(TAG, "Unable to navigate to fragment: " + e.getMessage()); + } } public boolean getRotationEnabledSetting() {