Skip to content

Commit 5e6bcb6

Browse files
teng-linclaude
andcommitted
fix(android): remove duplicate unbindService call in onDestroy
The service is already unbound in onStop(), so calling unbindService() again in onDestroy() causes "Service not registered" error. Remove the duplicate unbind call since onStop() is called before onDestroy(). Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
1 parent b1a1fea commit 5e6bcb6

1 file changed

Lines changed: 0 additions & 8 deletions

File tree

android/app/src/main/java/me/kavishdevar/librepods/MainActivity.kt

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -164,14 +164,6 @@ class MainActivity : ComponentActivity() {
164164
}
165165

166166
override fun onDestroy() {
167-
try {
168-
if (::serviceConnection.isInitialized) {
169-
unbindService(serviceConnection)
170-
Log.d("MainActivity", "Unbound service")
171-
}
172-
} catch (e: Exception) {
173-
Log.e("MainActivity", "Error while unbinding service: $e")
174-
}
175167
try {
176168
if (::connectionStatusReceiver.isInitialized) {
177169
unregisterReceiver(connectionStatusReceiver)

0 commit comments

Comments
 (0)