Fixed it.

FYI ~ I moved the whole TTS process from my activity to a class by
itself (other activities are going to be using it anyway), but then,
instead of using "this" for the first parameter of the TextToSpeech()
function, I used getApplicationContext(). I also initialized mTts
after initializing all my sensors and gps and stuff.

Ken

On Mar 1, 11:25 am, Ken H <hunt1...@gmail.com> wrote:
> I've tested the APIDemo TestToSpeech example code on my phone (Galaxy
> S2) and it works fine, but when I take the *same code* and paste it
> into my app the TTS fails. I see an error in the LogCat saying
> "intTts() failed to bind to service".
>
> I suspect the problem is in the line:
>
> mTts = new TextToSpeech(this, this);
>
> because this is the intitialization line, and the status I see
> returned in the onInit() is always -1. I'm initializing WiFi, gps, the
> phonestatelistener, among other things in this app. Is there a
> sequence I need to follow? Should I start TTS before/after something?
>
> What is the second arguement in the TestToSpeech() arguement really?
> The documentation says it's OnInitListener that gets call after
> initialization, but that just confuses me further (I'm using "this"
> for both parts). I'm completely stumped.
>
> Ken

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to