0

I have a recyclerView in a fragment which I use it to show some items. When selecting these items I change my toolbar title to number of selected items and also I change menu options. how can I make pressing back button cancel the selection operation?

h_coder
  • 29
  • 1
  • 7

1 Answers1

0

You override the

onBackPressed()

Method and do what you want there. Any back key press will trigger this function and you'll be able to use your logic

Kushan
  • 5,855
  • 3
  • 31
  • 45