Просмотр исходного кода

修复重复进入无法朗读入账信息

zengjiebin лет назад: 7
Родитель
Сommit
dfaa159712
1 измененных файлов с 2 добавлено и 2 удалено
  1. 2 2
      app/src/main/java/com/sheep/gamegroup/util/TextToSpeechUtil.java

+ 2 - 2
app/src/main/java/com/sheep/gamegroup/util/TextToSpeechUtil.java

@@ -3,7 +3,6 @@ package com.sheep.gamegroup.util;
 import android.speech.tts.TextToSpeech;
 import android.text.TextUtils;
 
-import com.bumptech.glide.Glide;
 import com.sheep.jiuyan.samllsheep.SheepApp;
 import com.sheep.jiuyan.samllsheep.utils.G;
 
@@ -24,7 +23,7 @@ public class TextToSpeechUtil {
      */
     public static TextToSpeechUtil get() {
         if (instance == null) {
-            synchronized (Glide.class) {
+            synchronized (TextToSpeechUtil.class) {
                 if (instance == null) {
                     instance = new TextToSpeechUtil();
                 }
@@ -168,6 +167,7 @@ public class TextToSpeechUtil {
     public static void stopTTS(){
         if(instance != null){
             instance.stopAndShutdownTTS();
+            instance = null;
         }
     }
 }