I just released a big update to the auto responder!
Initially I made the broadcast receiver using a seperate class and added it through the manifest. While it worked good, doing it that way meant that ANY time an SMS message came in the receiver caught it and started the service. This is a good thing if one wants that sort of functionality. I, however, only want the service running if the user explicity turns it on.
To make sure it behaved properly, I set a boolean flag of sorts when the user started the auto responder. I then checked if that flag was true whenever the service started. If it was false then i had the service shut itself down.
This works good for sure but it never sat well with me.
Now I am using a dynamically registered BroadcastReceiver within my service which is *only* registered when the service is created!
I think this is a much better solution ;)
0 comments:
Post a Comment