From a3c3fc082dd615969b94875e2d2571496f3536a0 Mon Sep 17 00:00:00 2001 From: Christian Basler Date: Sat, 6 Feb 2016 13:24:25 +0100 Subject: [PATCH] Fixed error when responding to messages with a very short subject --- .../ch/dissem/apps/abit/MessageDetailFragment.java | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.java b/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.java index 8296c63..c86b690 100644 --- a/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.java +++ b/app/src/main/java/ch/dissem/apps/abit/MessageDetailFragment.java @@ -157,10 +157,14 @@ public class MessageDetailFragment extends Fragment { ComposeMessageActivity.class); replyIntent.putExtra(EXTRA_RECIPIENT, item.getFrom()); replyIntent.putExtra(EXTRA_IDENTITY, item.getTo()); - replyIntent.putExtra(EXTRA_SUBJECT, - (item.getSubject().substring(0, 3).equalsIgnoreCase("RE:") ? "" : "RE: ") - + item.getSubject() - ); + String prefix; + if (item.getSubject().length() >= 3 && item.getSubject().substring(0, 3) + .equalsIgnoreCase("RE:")) { + prefix = ""; + } else { + prefix = "RE: "; + } + replyIntent.putExtra(EXTRA_SUBJECT, prefix + item.getSubject()); startActivity(replyIntent); return true; case R.id.delete: