aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/cgeo/geocaching/CacheDetailActivity.java
diff options
context:
space:
mode:
Diffstat (limited to 'main/src/cgeo/geocaching/CacheDetailActivity.java')
-rw-r--r--main/src/cgeo/geocaching/CacheDetailActivity.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/main/src/cgeo/geocaching/CacheDetailActivity.java b/main/src/cgeo/geocaching/CacheDetailActivity.java
index 9b57f0d..ac9d4b9 100644
--- a/main/src/cgeo/geocaching/CacheDetailActivity.java
+++ b/main/src/cgeo/geocaching/CacheDetailActivity.java
@@ -2019,7 +2019,14 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc
return;
}
if (StringUtils.isNotBlank(descriptionString)) {
- descriptionView.setText(description, TextView.BufferType.SPANNABLE);
+ try {
+ descriptionView.setText(description, TextView.BufferType.SPANNABLE);
+ } catch (Exception e) {
+ // On 4.1, there is sometimes a crash on measuring the layout: https://code.google.com/p/android/issues/detail?id=35412
+ Log.e("Android bug setting text: ", e);
+ // remove the formatting by converting to a simple string
+ descriptionView.setText(description.toString());
+ }
descriptionView.setMovementMethod(AnchorAwareLinkMovementMethod.getInstance());
fixTextColor(descriptionView, descriptionString);
descriptionView.setVisibility(View.VISIBLE);
@@ -2054,7 +2061,7 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc
/**
* Handle caches with black font color in dark skin and white font color in light skin
* by changing background color of the view
- *
+ *
* @param view
* containing the text
* @param text
@@ -2156,7 +2163,7 @@ public class CacheDetailActivity extends AbstractViewPagerActivity<CacheDetailAc
final LogEntry log = getItem(position);
if (log.date > 0) {
- holder.date.setText(Formatter.formatShortDate(log.date));
+ holder.date.setText(Formatter.formatShortDateVerbally(log.date));
holder.date.setVisibility(View.VISIBLE);
} else {
holder.date.setVisibility(View.GONE);