Prevented IllegalArgumentException if service was not registered

This commit is contained in:
daniel oeh 2012-09-11 12:50:21 +02:00
parent fd6f93abc1
commit 4a22f1be42
1 changed files with 5 additions and 1 deletions

View File

@ -44,7 +44,11 @@ public class PlayerWidgetService extends Service {
super.onDestroy();
if (AppConfig.DEBUG)
Log.d(TAG, "Service is about to be destroyed");
unbindService(mConnection);
try {
unbindService(mConnection);
} catch (IllegalArgumentException e) {
Log.w(TAG, "IllegalArgumentException when trying to unbind service");
}
}
@Override