I use this code to listen to volume key button press: https://stackoverflow.com/a/27855766/2977288
But when the user holds the volume button, the listener gets fired again and again.
How can I stop that and only listen once, when the button is clicked and not when the button is press constantly?