Only react to onContextItemSelected if something was actually selected

This commit is contained in:
ByteHamster 2021-03-06 21:44:35 +01:00
parent dd0502c0d6
commit a3da79235a
1 changed files with 4 additions and 2 deletions

View File

@ -134,8 +134,10 @@ public class NavDrawerFragment extends Fragment implements SharedPreferences.OnS
@Override
public boolean onContextItemSelected(@NonNull MenuItem item) {
if (contextPressedItem.type == NavDrawerData.DrawerItem.Type.FEED) {
return onFeedContextMenuClicked(((NavDrawerData.FeedDrawerItem) contextPressedItem).feed, item);
NavDrawerData.DrawerItem pressedItem = contextPressedItem;
contextPressedItem = null;
if (pressedItem != null && pressedItem.type == NavDrawerData.DrawerItem.Type.FEED) {
return onFeedContextMenuClicked(((NavDrawerData.FeedDrawerItem) pressedItem).feed, item);
}
return false;
}