I am making a music player app. I made a custom notification with player buttons. While other things are just working fine, I am unable to find on how can I quit application when user presses quit button on the notification.
I tried system.exit() and musicService.stopSelf() but of no use from here.
Related
I have a player in my app. The sounds we play on this player are also displayed in the notification bar. When you click on this notification, it should redirect to the application. It plays a sound and redirects after clicking. But sometimes after changing the voice or pressing the forward/backward, play/pause buttons, it does not lead to the application. This issue occurs on android.
I opened a blank screen and just added react-native-track-player and two buttons. Here the first button adds and plays a random sound. The other button resets. But still the same problem persists.
I am currently starting an activity in watch from mobile by clicking a button. I am using wearable listener service to do it. Once the activity is started, the user performs gestures which are recognized and sent to mobile. So at some point in time, I want the user to click a button in mobile to close/pause this activity in watch. How can I do it? Should I destroy it or pause it? What should be my approach? Please advise
When you receive the message telling to close app in watch from phone,you can cancel all running work and close all activities in watch app or call System.exit(0).
I have developed a music player app that uses a foreground service and have used Remote views within a notification for displaying controls(play/pause, next, previous). When a user taps the notification, how could I make appropriate changes to the controls displayed in the Activity like the seek bar progress and other UI updates with respect to the current song.
Hi please try with below open source project , you will get help from these projects
UniversalMusicPlayer
JamsMusicPlayer
TurtlePlayer
Android 4.0 which is now allow the developer to disable the application.
Then I developed a service to bring to application to foreground when the user click the home button.
Now I can bring the application to foreground successful.
But each time I opened the application and then click home button.
it will show the launcher and delay 5-6 second to bring to application to foreground.
I find that the service retried a few time to bring the application to foreground.
But when I click the button on the launcher, it will bring the application to foreground immediately.
Any solution to fix the delay problem?
Thanks.
I am using phonegap with Android.I have a sound playing repeatedly with a timer.If I close the app the sound continues to play.Is there a app closing handler or something I could use to make the sound stop when the app exits.
I am using a Samsung Captivate(Galaxy S).If I press the back button the sound stops when the app exits.But if I press the home button then the sound just goes on forever when the app exits.
Thanks
You can catch the backbutton and stop the music playing and then close the app.
It's however not possible (as far as i know) to catch the close event.
http://wiki.phonegap.com/w/page/29494136/Android-Back-Button-Handler
Here is how to do that.