[solved]Hardware Audio buttons not working with my app.



  • Does anyone know how make the hardware audio buttons work for android? I am using media streamer to play the audio and it plays just fine but I cant change the volume with the hardware audio buttons. They actually don'd do anything when I press them when I am in the app. It will change the volume when I have the app running in the background with the audio playing. When the app is the main activity the buttons don't work but when it is not the main activity the buttons do not work. Any help here would be appreciated!
    I have also tried the app on 5 different devices with the same result.



  • The problem arise because the QtActivity handles every buttons (from the android operating system point of view)… but QtActivity also does nothing by default. The results is that the hardware audio buttons are handled by QtActivity and hence the default behavior is not triggered and at the same time QtActivity simply do nothing.

    The only solution I found was to change the code of QtActivity … in a zone where comments says "never change!!": the implementation of onKeyDown inside QtActivity



  • @Gianluca I appreciate this answer very much! This is the first bit of help I have found on this subject. Thank you. I got it now! Thanks!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.