From f392afe87f71c6330ba95260a938e29e2a5d9041 Mon Sep 17 00:00:00 2001 From: Viktor De Pasquale Date: Sat, 25 May 2019 19:20:36 +0200 Subject: [PATCH] Added error message in case Markdown window fails to load --- .../java/com/topjohnwu/magisk/view/MarkDownWindow.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/com/topjohnwu/magisk/view/MarkDownWindow.java b/app/src/main/java/com/topjohnwu/magisk/view/MarkDownWindow.java index f6da7a795..9e4017424 100644 --- a/app/src/main/java/com/topjohnwu/magisk/view/MarkDownWindow.java +++ b/app/src/main/java/com/topjohnwu/magisk/view/MarkDownWindow.java @@ -3,6 +3,7 @@ package com.topjohnwu.magisk.view; import android.content.Context; import android.view.LayoutInflater; import android.view.View; +import android.widget.TextView; import com.topjohnwu.magisk.R; import com.topjohnwu.net.Networking; @@ -50,7 +51,13 @@ public class MarkDownWindow { AlertDialog.Builder alert = new AlertDialog.Builder(activity); alert.setTitle(title); View mv = LayoutInflater.from(activity).inflate(R.layout.markdown_window, null); - markwon.setMarkdown(mv.findViewById(R.id.md_txt), md); + TextView tv = mv.findViewById(R.id.md_txt); + try { + markwon.setMarkdown(tv, md); + } catch (ExceptionInInitializerError e) { + //Nothing we can do about this error other than show error message + tv.setText(R.string.download_file_error); + } alert.setView(mv); alert.setNegativeButton(R.string.close, (dialog, id) -> dialog.dismiss()); alert.show();