简体   繁体   中英

Issue with Media Controls in MediaStyle Notifications on Android Lollipop

So, I just rebuilt my MediaPlayer service from the ground up, mainly to improve and update the code, but also because it just WASN'T going to work with MediaStyle notifications.

So, now I have a notification, and when I press the Pause button, it logs "onPause" although nothing else I have set to log in the onPause is there in the logs, and they all use the same tag, so that's weird.)

What it does though, that really bugs me. It logs that I pressed the right button, but then it just seems to start another mediaplayer and play that.

This is the offending class. The latest debug and release signed APKs can be found in the mobile package if you want to see the behavior for yourself.

Is there something I'm missing in, say, the AndroidManifest.xml ? The service seems to be receiving the intent, but just ignoring it, which is weird.

I'm honestly lost. I barely have a grasp on intents or pendingintents , let alone IBinders .

My compiler wasn't working properly. My code was fine. Somewhere between compiling and installing, it used an older version of the APK, or at least one class.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM