diff options
Diffstat (limited to 'src/cgeo/geocaching/cgeopopup.java')
| -rw-r--r-- | src/cgeo/geocaching/cgeopopup.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/cgeo/geocaching/cgeopopup.java b/src/cgeo/geocaching/cgeopopup.java index 8531338..9b1d816 100644 --- a/src/cgeo/geocaching/cgeopopup.java +++ b/src/cgeo/geocaching/cgeopopup.java @@ -2,6 +2,8 @@ package cgeo.geocaching; import java.util.Locale; +import org.apache.commons.lang3.StringUtils; + import android.app.ProgressDialog; import android.content.Intent; import android.content.res.Configuration; @@ -117,7 +119,7 @@ public class cgeopopup extends AbstractActivity { geocode = extras.getString("geocode"); } - if (geocode == null || geocode.length() == 0) { + if (StringUtils.isBlank(geocode)) { showToast(res.getString(R.string.err_detail_cache_find)); finish(); @@ -212,7 +214,7 @@ public class cgeopopup extends AbstractActivity { TextView itemValue; LinearLayout itemStars; - if (cache.name != null && cache.name.length() > 0) { + if (StringUtils.isNotBlank(cache.name)) { setTitle(cache.name); } else { setTitle(geocode.toUpperCase()); @@ -235,13 +237,13 @@ public class cgeopopup extends AbstractActivity { itemName.setText(res.getString(R.string.cache_type)); if (cgBase.cacheTypesInv.containsKey(cache.type)) { // cache icon - if (cache.size != null && cache.size.length() > 0) { + if (StringUtils.isNotBlank(cache.size)) { itemValue.setText(cgBase.cacheTypesInv.get(cache.type) + " (" + cache.size + ")"); } else { itemValue.setText(cgBase.cacheTypesInv.get(cache.type)); } } else { - if (cache.size != null && cache.size.length() > 0) { + if (StringUtils.isNotBlank(cache.size)) { itemValue.setText(cgBase.cacheTypesInv.get("mystery") + " (" + cache.size + ")"); } else { itemValue.setText(cgBase.cacheTypesInv.get("mystery")); @@ -662,4 +664,4 @@ public class cgeopopup extends AbstractActivity { super.goManual(view); finish(); } -}
\ No newline at end of file +} |
