M MetalOS Member Licensed User Longtime User Dec 29, 2018 #1 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: Expand Collapse Copy player1.Play player1.Pause But I do not know what to call them in Erel's example. Thanks for your help.
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: Expand Collapse Copy 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 Dec 29, 2018 #2 MetalOS said: But I do not know what to call them in Erel's example. Click to expand... 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
MetalOS said: But I do not know what to call them in Erel's example. Click to expand... 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.
M MetalOS Member Licensed User Longtime User Dec 29, 2018 #3 I returned the code in all directions and frankly I do not see how to do :-( Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 30, 2018 #4 DonManfred said: 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. Click to expand... Have you added a service to your project as done in the example? Upvote 0
DonManfred said: 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. Click to expand... Have you added a service to your project as done in the example?
M MetalOS Member Licensed User Longtime User Dec 30, 2018 #5 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
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 ;-)
AnandGupta Expert Licensed User Longtime User Dec 30, 2018 #6 We can help you, if you upload your project here. It is good practice for beginners. Regards, Anand Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Dec 30, 2018 #7 Check this tutorial: Using CallSubDelayed to interact between activities and services Upvote 0