Autore Topic: tts di ma Errore  (Letto 542 volte)

Offline davidino81

  • Utente junior
  • **
  • Post: 66
  • Respect: 0
    • Mostra profilo
  • Dispositivo Android:
    htc one v
  • Sistema operativo:
    Windows 7
tts di ma Errore
« il: 09 Gennaio 2013, 12:25:44 CET »
0
Ciao a tutti, ho finito la mia app ma mi sono accorto che ogni volta che cambio orientazione (quindi si ricrea l'activity) ottengo questo errore che però non mi blocca il programma. A cosa è dovuto ? come faccio a sistemarlo ?
Grazie in anticipo.

LogCat:

Codice: [Seleziona]
01-09 12:18:16.575: I/me(14285): impara onPause
01-09 12:18:16.595: I/me(14285): tts stop and shutdoqwn
01-09 12:18:16.615: I/me(14285): impara onStop
01-09 12:18:16.615: I/me(14285): impara onDestroy
01-09 12:18:16.615: D/memalloc(14285): ion: Unmapping buffer  base:0x54eec000 size:2088960
01-09 12:18:16.615: D/memalloc(14285): ion: Unmapping buffer  base:0x4007e000 size:4096
01-09 12:18:16.615: D/memalloc(14285): ion: Unmapping buffer  base:0x5528c000 size:2088960
01-09 12:18:16.615: D/memalloc(14285): ion: Unmapping buffer  base:0x4009b000 size:4096
01-09 12:18:16.625: D/memalloc(14285): ion: Unmapping buffer  base:0x53bf0000 size:2088960
01-09 12:18:16.625: D/memalloc(14285): ion: Unmapping buffer  base:0x4002f000 size:4096
01-09 12:18:16.635: I/me(14285): impara onCreate
01-09 12:18:16.675: I/dalvikvm-heap(14285): Grow heap (frag case) to 17.600MB for 1397136-byte allocation
01-09 12:18:16.725: I/TextToSpeech(14285): Sucessfully bound to com.google.android.tts
01-09 12:18:16.735: I/ME(14285): Ripresa parola dopo cambio orientazione
01-09 12:18:16.755: I/TextToSpeech(14285): Sucessfully bound to com.google.android.tts
01-09 12:18:16.795: I/me(14285): impara onStart
01-09 12:18:16.795: I/me(14285): impara onResume
01-09 12:18:16.815: D/libc(14285): pt_debug : pthread_create->start_routine=0x50e04e31, tls=0x53cecf00, arg=0x513b0f38
01-09 12:18:16.815: D/libc(14285): pt_debug : __thread_entry->func=0x50e04e31
01-09 12:18:16.815: D/libc(14285): , tls=0x53cecf00, arg=0x513b0f38
01-09 12:18:16.815: D/memalloc(14285): ion: Mapped buffer base:0x5444f000 size:2088960 offset:0 fd:63
01-09 12:18:16.815: D/memalloc(14285): ion: Mapped buffer base:0x40018000 size:4096 offset:0 fd:66
01-09 12:18:16.835: I/TextToSpeech(14285): Connected to ComponentInfo{com.google.android.tts/com.google.android.tts.GoogleTTSService}
01-09 12:18:16.835: W/TextToSpeech(14285): setLanguage failed: not bound to TTS engine
01-09 12:18:16.835: I/TextToSpeech(14285): Connected to ComponentInfo{com.google.android.tts/com.google.android.tts.GoogleTTSService}
01-09 12:18:16.835: E/ActivityThread(14285): Activity com.imparavocabolieverbi.ImparaActivity has leaked ServiceConnection android.speech.tts.TextToSpeech$Connection@4186fd30 that was originally bound here
01-09 12:18:16.835: E/ActivityThread(14285): android.app.ServiceConnectionLeaked: Activity com.imparavocabolieverbi.ImparaActivity has leaked ServiceConnection android.speech.tts.TextToSpeech$Connection@4186fd30 that was originally bound here
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.LoadedApk$ServiceDispatcher.<init>(LoadedApk.java:1055)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.LoadedApk.getServiceDispatcher(LoadedApk.java:949)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.ContextImpl.bindService(ContextImpl.java:1464)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.ContextImpl.bindService(ContextImpl.java:1456)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.content.ContextWrapper.bindService(ContextWrapper.java:394)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.speech.tts.TextToSpeech.connectToEngine(TextToSpeech.java:627)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.speech.tts.TextToSpeech.initTts(TextToSpeech.java:597)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:553)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:527)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.speech.tts.TextToSpeech.<init>(TextToSpeech.java:512)
01-09 12:18:16.835: E/ActivityThread(14285):         at com.imparavocabolieverbi.ImparaActivity.set_audio_language(ImparaActivity.java:638)
01-09 12:18:16.835: E/ActivityThread(14285):         at com.imparavocabolieverbi.ImparaActivity.onCreate(ImparaActivity.java:140)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.Activity.performCreate(Activity.java:5066)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1101)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2307)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2387)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.ActivityThread.access$600(ActivityThread.java:151)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1331)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.os.Handler.dispatchMessage(Handler.java:99)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.os.Looper.loop(Looper.java:155)
01-09 12:18:16.835: E/ActivityThread(14285):         at android.app.ActivityThread.main(ActivityThread.java:5454)
01-09 12:18:16.835: E/ActivityThread(14285):         at java.lang.reflect.Method.invokeNative(Native Method)
01-09 12:18:16.835: E/ActivityThread(14285):         at java.lang.reflect.Method.invoke(Method.java:511)
01-09 12:18:16.835: E/ActivityThread(14285):         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1029)
01-09 12:18:16.835: E/ActivityThread(14285):         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:796)
01-09 12:18:16.835: E/ActivityThread(14285):         at dalvik.system.NativeStart.main(Native Method)
01-09 12:18:16.865: D/memalloc(14285): ion: Mapped buffer base:0x54eec000 size:2088960 offset:0 fd:68

ImparaActivity.set_audio_language(ImparaActivity.java:638):

Codice (Java): [Seleziona]
tts_parola = new TextToSpeech(this, new TextToSpeech.OnInitListener() {
        @Override
        public void onInit(int status) {
                        if (status != TextToSpeech.ERROR){
                                if (prefs.getString("ling2", "no").equals("ita")){
                        tts_parola.setLanguage(Locale.ITALIAN);
                                }
                        if (prefs.getString("ling2", "no").equals("eng")){
                                tts_parola.setLanguage(Locale.UK);            
                                        }
                        if (prefs.getString("ling2", "no").equals("fra")){
                                tts_parola.setLanguage(Locale.FRANCE);
                                }
                        if (prefs.getString("ling2", "no").equals("spa")){
                                tts_parola.setLanguage(new Locale("es","ES"));
                                        }
                        if (prefs.getString("ling2", "no").equals("ger")){
                                tts_parola.setLanguage(Locale.GERMANY);
                                }
                        if (prefs.getString("ling2", "no").equals("por")){
                                tts_parola.setLanguage(new Locale("pt","PT"));
        }

                }
                else {
                        Log.i("ME", "problema");
                       
                                               
                }
                       
                }
        });

In onPause:

Codice (Java): [Seleziona]
       
dbhPagella.close();
if (tts_parola != null){
        Log.i("me", "tts stop and shutdoqwn");
        tts_parola.stop();
        tts_parola.shutdown();
}