Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

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

    Mobile and Embedded
    2
    3
    900
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • K
      koolbi last edited by

      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.

      1 Reply Last reply Reply Quote 0
      • Gianluca
        Gianluca last edited by

        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

        1 Reply Last reply Reply Quote 0
        • K
          koolbi last edited by

          @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!

          1 Reply Last reply Reply Quote 0
          • First post
            Last post