Android Question Notification

MetalOS

Member
Licensed User
Longtime User
Hello, I reused the example provided by Erel on his post to manage the notification:

https://www.b4x.com/android/forum/threads/nb6-notifications-builder-class-2018.91819/#content

I use the "notification with actions" for my radio player. Only I do not know how to use AddButtonAction to play or pause the player. I know the command that allows to play or pause the player because I use the ExoPlayer library

B4X:
player1.Play
player1.Pause

But I do not know what to call them in Erel's example. Thanks for your help.
 

DonManfred

Expert
Licensed User
Longtime User
But I do not know what to call them in Erel's example.
check the example code! It is all there already.

When using the actions and you click on one of the actions the service MyService is started and it is logging the ACTION. It is up to you to call a method which stop play or whatever you want to do with the action.
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
When using the actions and you click on one of the actions the service MyService is started and it is logging the ACTION. It is up to you to call a method which stop play or whatever you want to do with the action.
Have you added a service to your project as done in the example?
 
Upvote 0

MetalOS

Member
Licensed User
Longtime User
Yes I added a service but what I do not understand is how to call the playback and pause commands in this service. Sorry I'm a beginner in programming and on B4A that I find really top in the process ;-)
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…