From 99e3cdda1aa77e172f2c82830d288b3408002dc1 Mon Sep 17 00:00:00 2001 From: Thomas Date: Sun, 20 Nov 2022 16:00:03 +0100 Subject: [PATCH] Fix issue #488 - Copy content of a message doesn't work --- .../java/app/fedilab/android/ui/drawer/StatusAdapter.java | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java index d0399a769..bc36b5ef6 100644 --- a/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java +++ b/app/src/main/java/app/fedilab/android/ui/drawer/StatusAdapter.java @@ -1934,7 +1934,12 @@ public class StatusAdapter extends RecyclerView.Adapter context.startActivity(intent); } else if (itemId == R.id.action_copy) { ClipboardManager clipboard = (ClipboardManager) context.getSystemService(Context.CLIPBOARD_SERVICE); - ClipData clip = ClipData.newPlainText(Helper.CLIP_BOARD, status.text); + String content; + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.N) + content = Html.fromHtml(statusToDeal.content, Html.FROM_HTML_MODE_LEGACY).toString(); + else + content = Html.fromHtml(statusToDeal.content).toString(); + ClipData clip = ClipData.newPlainText(Helper.CLIP_BOARD, content); if (clipboard != null) { clipboard.setPrimaryClip(clip); Toasty.info(context, context.getString(R.string.clipboard), Toast.LENGTH_LONG).show();