Search code examples
androidandroid-auto

Grab the events from the Hardware buttons [Android Auto]


Can't seem to grab the events from the Hardware buttons.

Setting the Media session callback and doing this:

mSession.setFlags(MediaSession.FLAG_HANDLES_MEDIA_BUTTONS |
                MediaSession.FLAG_HANDLES_TRANSPORT_CONTROLS);

But no luck. Any ideas?


Solution

  • Was missing the setActive on the MediaSession.