pires/android-obd-reader — pull request #33 by spapas (2014-07-28 15:27:32+00:00)
Title: Fix #22 and refactor service binding code

The issue #22 probably was because the ``onServiceDisconnected `` won't be called when the client unbinds from the service (http://developer.android.com/guide/components/bound-services.html) but only when the service unbinds (unexpectedly) from the client. So even though we unbinded from the service, the isServiceBound was still true. This is fixed by doing ``isServicBound = false`` on the ``doUnbindService`` method.

Also, with this version, instead of binding the service at the ``onStart`` method, we bind (and start it) when the "Start Live Data" has been pressed. I believe that this is a better approach since the service is used *only* when the Live Data is running so there is no need to bind to it when the Activity starts. After that, when we press "Stop Live Data" we stop and unbind the service.