From 6339a0ff34920242584871c7a8a707fdd6571772 Mon Sep 17 00:00:00 2001 From: Daniel Lublin Date: Mon, 20 Apr 2020 15:40:01 +0200 Subject: Change alert for pref change requiring reconnect into a toast This avoids the issue with that alert which seems to have to be of the system type (to appear properly, somehow?) and thus requires the draw-over-apps permission. A permission we might not yet have been granted. --- app/src/main/java/se/lublin/mumla/service/MumlaService.java | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/app/src/main/java/se/lublin/mumla/service/MumlaService.java b/app/src/main/java/se/lublin/mumla/service/MumlaService.java index e9c927b..273ff5d 100644 --- a/app/src/main/java/se/lublin/mumla/service/MumlaService.java +++ b/app/src/main/java/se/lublin/mumla/service/MumlaService.java @@ -30,11 +30,8 @@ import android.os.IBinder; import android.os.PowerManager; import android.preference.PreferenceManager; import android.speech.tts.TextToSpeech; -import android.view.WindowManager; import android.widget.Toast; -import androidx.appcompat.app.AlertDialog; - import org.jsoup.Jsoup; import org.jsoup.nodes.Document; import org.jsoup.nodes.Element; @@ -451,13 +448,7 @@ public class MumlaService extends HumlaService implements } if (requiresReconnect && isConnectionEstablished()) { - AlertDialog ad = new AlertDialog.Builder(this) - .setTitle(R.string.information) - .setMessage(R.string.change_requires_reconnect) - .setPositiveButton(android.R.string.ok, null) - .create(); - ad.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); - ad.show(); + Toast.makeText(this, R.string.change_requires_reconnect, Toast.LENGTH_LONG).show(); } } -- cgit v1.2.3