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?
            Asked
            
        
        
            Active
            
        
            Viewed 72 times
        
    1 Answers
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
