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() {