mirror of
https://github.com/topjohnwu/Magisk.git
synced 2025-04-22 12:21:32 +00:00
Added error message in case Markdown window fails to load
This commit is contained in:
parent
6a243ec7bc
commit
f392afe87f
@ -3,6 +3,7 @@ package com.topjohnwu.magisk.view;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
import com.topjohnwu.magisk.R;
|
import com.topjohnwu.magisk.R;
|
||||||
import com.topjohnwu.net.Networking;
|
import com.topjohnwu.net.Networking;
|
||||||
@ -50,7 +51,13 @@ public class MarkDownWindow {
|
|||||||
AlertDialog.Builder alert = new AlertDialog.Builder(activity);
|
AlertDialog.Builder alert = new AlertDialog.Builder(activity);
|
||||||
alert.setTitle(title);
|
alert.setTitle(title);
|
||||||
View mv = LayoutInflater.from(activity).inflate(R.layout.markdown_window, null);
|
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.setView(mv);
|
||||||
alert.setNegativeButton(R.string.close, (dialog, id) -> dialog.dismiss());
|
alert.setNegativeButton(R.string.close, (dialog, id) -> dialog.dismiss());
|
||||||
alert.show();
|
alert.show();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user