From 82f9362016dbb6520374f9bca1043df35bca7117 Mon Sep 17 00:00:00 2001 From: Raffaele Date: Sun, 7 Jun 2015 23:06:57 +0200 Subject: [PATCH] fix on check boolean --- app/src/main/java/com/educationet/k12/app/TTSManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/com/educationet/k12/app/TTSManager.java b/app/src/main/java/com/educationet/k12/app/TTSManager.java index 9a2a2f1..7a4c339 100644 --- a/app/src/main/java/com/educationet/k12/app/TTSManager.java +++ b/app/src/main/java/com/educationet/k12/app/TTSManager.java @@ -10,7 +10,7 @@ import android.util.Log; public class TTSManager{ - private final boolean ttsenable; + private boolean ttsenable; private TextToSpeech myTTS; private boolean readyToSpeak = false; private Context context; @@ -20,6 +20,7 @@ public TTSManager(Context baseContext) SharedPreferences SP = PreferenceManager.getDefaultSharedPreferences(baseContext); ttsenable=SP.getBoolean("tts.enable",false); this.context = baseContext; + Log.d("TTS","Status:"+ttsenable); } public void initOrInstallTTS(){ @@ -52,9 +53,8 @@ public void destroy(){ Log.d("Activity", "TTS Destroyed"); } } - public void speak(String text) - { - if (readyToSpeak&&ttsenable) ; + public void speak(String text){ + if ((readyToSpeak)&&(ttsenable=true)) myTTS.speak(text, TextToSpeech.QUEUE_FLUSH, null); }