Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix disconnection of the service when the activity dies #1272

Merged
merged 4 commits into from
Aug 25, 2024

Conversation

oguzsout
Copy link
Contributor

No description provided.

@z-huang
Copy link
Owner

z-huang commented Aug 12, 2024

Can you explain this PR in more detail?

@oguzsout
Copy link
Contributor Author

Even if you listen to the music from the application or pause and close it, the service runs in the background, so the music should stop when the application is closed, so the service should stop. I opened a fix pr because I saw this problem.

@ruskcoder
Copy link

ruskcoder commented Aug 17, 2024

I actually kind of like not patching this, many times I click close all, and that would stop my music 😅

@z-huang
Copy link
Owner

z-huang commented Aug 21, 2024

Yeah, that's why I didn't merge this PR directly. Some people may want to leave the music playing when they kill the app, while some may want to stop the music when they kill the app.

@dainvincible1
Copy link

Yeah, that's why I didn't merge this PR directly. Some people may want to leave the music playing when they kill the app, while some may want to stop the music when they kill the app.

it will be better if there was a toggle. people can choose whatever they want themselves

@z-huang z-huang merged commit 268054b into z-huang:dev Aug 25, 2024
2 checks passed
@z-huang
Copy link
Owner

z-huang commented Aug 25, 2024

Thanks!

@z-huang
Copy link
Owner

z-huang commented Aug 26, 2024

Hi, I discovered a bug: play a song and change screen rotation, then the app crashed.
Log:

Caused by: java.lang.IllegalArgumentException: Service not registered: com.zionhuang.music.MainActivity$serviceConnection$1@16caba3
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:2009)
at android.app.ContextImpl.unbindService(ContextImpl.java:2169)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:925)
at com.zionhuang.music.MainActivity.onDestroy(MainActivity.kt:193)

Can you fix it? Thanks!

@oguzsout
Copy link
Contributor Author

Hello, I think there is an improvement in this pr related to the problem

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants