From 830b5ad9dd3431d7412b06a43341ba2a38da3788 Mon Sep 17 00:00:00 2001 From: Amr Hossam Date: Sat, 24 Feb 2024 22:08:07 +0200 Subject: [PATCH] Fix #1116 Html parsing. --- .../org/onebusaway/android/ui/SituationDialogFragment.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/onebusaway-android/src/main/java/org/onebusaway/android/ui/SituationDialogFragment.java b/onebusaway-android/src/main/java/org/onebusaway/android/ui/SituationDialogFragment.java index 700dacd4b..4133138fd 100644 --- a/onebusaway-android/src/main/java/org/onebusaway/android/ui/SituationDialogFragment.java +++ b/onebusaway-android/src/main/java/org/onebusaway/android/ui/SituationDialogFragment.java @@ -21,6 +21,7 @@ import android.content.Intent; import android.net.Uri; import android.os.Bundle; +import android.text.Html; import android.text.TextUtils; import android.text.style.ClickableSpan; import android.view.View; @@ -154,7 +155,7 @@ public void onClick(DialogInterface dialog, int which) { } }); - final androidx.appcompat.app.AlertDialog dialog = builder.create(); + final AlertDialog dialog = builder.create(); dialog.show(); // Set the title, description, and URL (if provided) @@ -162,8 +163,10 @@ public void onClick(DialogInterface dialog, int which) { title.setText(args.getString(TITLE)); TextView desc = (TextView) dialog.findViewById(R.id.alert_description); - desc.setText(args.getString(DESCRIPTION)); + if (desc != null) { + desc.setText(Html.fromHtml(args.getString(DESCRIPTION))); + } TextView urlView = (TextView) dialog.findViewById(R.id.alert_url); // Remove any previous clickable spans just to be safe