0

when I use android 4.4.4 (Galaxy Nexus) minus button plays next song. plus button plays previous song. But android 5.0 (Nexus 4) no actions for these buttons. if android no longer support these buttons. I wan't to implement myself.

How can I receive key event from these media buttons?

I've tested these methods. But no luck.

AudioManager.registerMediaButtonEventReceiver
MediaSession.setCallback

and

<intent-filter android:priority="2147483647">
     <action android:name="android.intent.action.MEDIA_BUTTON" />
</intent-filter>

image http://cdn.shopclues.net/images/detailed/403/ForSAMSUNGGALAXYS3IIIS4I9300ForSAMSUNGGALAXYNoteN7000Note2N7100HANDSFREEHEADPHONES1_1365530097.jpg

3
  • Possibly related: android.stackexchange.com/questions/44144/…, android.stackexchange.com/questions/62761/…. Anyway, Android development is off-topic here.
    – Andrew T.
    Apr 13, 2015 at 5:56
  • Now I think it's related product vendor. Samsung phone works nice with samsung headphone. Nexus 4 is LG phone. Maybe I need lg standard headphone.
    – hurelhuyag
    Apr 16, 2015 at 8:53
  • That's a possibility. Unfortunately I don't have Samsung earphone to test. Though, you might consider to update your question to ask if it's possible to use Samsung earphone on Nexus or other devices than Samsung. (But you need to remove that bit code, since development-related is off-topic here :)
    – Andrew T.
    Apr 16, 2015 at 8:57

0

You must log in to answer this question.

Browse other questions tagged .