I'm a new Android programmer and I've been trying to develop an app that utilizes Google Voice Search's voice to text capabilities, calling it using an implicit intent. That's the part that works. However, I'm looking to only have GVS run for a set amount of time, so I've been looking for a way to kill the application.
I have tried: Finish() from several places in the program. If I could get some way to call GVS' finish() command, this would be ideal.
android.os.Process.killProcess(android.os.Process.myPid()) works, but it kills the entire app, which I don't want.
I am looking for: A way to kill the Google Voice Search app used in my program without killing the entire application. The only solution I have right now is to make an Activity that starts GVS and then kill that when I need GVS stopped, but that seems pointlessly messy. Anyone have a better solution?
Edit: I am not having trouble with the service itself. My intent and GVS are working perfectly. What I'm trying to do is interrupt the service so that, if I'm continually toggling the service back on whenever it turns off, I'll be able to stop the program after an amount of time. If I could terminate the process midway through, I'd be quite happy.
Edit2: I may have found a workaround for my issue in simply not refreshing the service when a timer is up.