In my activity, the action bar shows only the left arrow and the activity title.
When I click the left arrow, the activity returns to the previous action, but no events are logged in the onKeyUp, OnkeyDown and OnBackPressed methods.
But when I press the back key on the phone (bottom), the activity returns to the previous one, and all the onKeyUp, OnKeyDown and OnBackPressed methods register the event (in the logarithm).
How can I grab this left arrow (I think it is called the UP button)?
The reason I need to capture the key is to know in the onPause method that the action is destroyed by the user, and not by the system (for example, if the user switches to another activity).
With further research, it matters, I found that the UP button gives an event that is captured by the onOptionsItemSelected method, and since there is no other button in the menu, I know that this button.
source share