File tree Expand file tree Collapse file tree 2 files changed +13
-5
lines changed
app/src/main/java/com/futsch1/medtimer Expand file tree Collapse file tree 2 files changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -155,8 +155,12 @@ protected void onNewIntent(Intent intent) {
155
155
156
156
@ Override
157
157
public boolean onSupportNavigateUp () {
158
- NavController navController = findNavController (this , R .id .navHost );
159
- return NavigationUI .navigateUp (navController , appBarConfiguration )
160
- || super .onSupportNavigateUp ();
158
+ try {
159
+ NavController navController = findNavController (this , R .id .navHost );
160
+ return NavigationUI .navigateUp (navController , appBarConfiguration )
161
+ || super .onSupportNavigateUp ();
162
+ } catch (IllegalStateException e ) {
163
+ return false ;
164
+ }
161
165
}
162
166
}
Original file line number Diff line number Diff line change @@ -105,8 +105,12 @@ private static void enableOptionalIcons(@NonNull Menu menu) {
105
105
private void setupSettings () {
106
106
MenuItem item = menu .findItem (R .id .settings );
107
107
item .setOnMenuItemClickListener (menuItem -> {
108
- Navigation .findNavController (view ).navigate (R .id .action_global_preferencesFragment );
109
- return true ;
108
+ try {
109
+ Navigation .findNavController (view ).navigate (R .id .action_global_preferencesFragment );
110
+ return true ;
111
+ } catch (IllegalStateException e ) {
112
+ return false ;
113
+ }
110
114
});
111
115
}
112
116
You can’t perform that action at this time.
0 commit comments