Solving system crash on after closing not orderly

bug recreation scenario
open app
press button to start service
close app through task manager
start app again
button is red
press it once to close service - button should toggle but bug prevented
it
press it again to restart service  - button should toggle but bug caused
app to crash unexpectedly

problem analysis:
toggle button unbinds and rebinds to service. after unbind the next call
to the toggle method calls isScanning on an unbound service. This calls
crashes the second time after restart., in a way that after turning off
the service makes the next call cal to an unboundmakes the next call use
an unbounded service half ofsolution:
Start Scanning on App start
App stop does not prompt the user to close service anymore, s/he can do
it through the notification item as before