Is there Any possiblity to unbind the particular BoundedService from ServiceConnection with same instance for both..Any Help would be appreciated.
public static ServiceConnection connection = new ServiceConnection() {
@Override
public void onServiceConnected(ComponentName className, IBinder service) {
if (className.getClassName().contains("LoggingService")) {
LoggingService.LogBinder binder = (LoggingService.LogBinder) service;
myLogService = binder.getService();
myLogService.LoggingMethod("serviceconnection");
isBoundLog = true;
}
if (className.getClassName().contains("DownloadService")) {
DownloadService.DownloadBinder binder = (DownloadService.DownloadBinder) service;
myDwnloadServ = binder.getService();
isBoundDownload = true;
}
}
@Override
public void onServiceDisconnected(ComponentName className) {
if (className.getClassName().contains("LoggingService")) {
isBoundLog = false;
}
if (className.getClassName().contains("DownloadService")) {
isBoundDownload = false;
}
}
};