From 8103bf58d8b31e07a867d6cbfbdcd586c03be0ac Mon Sep 17 00:00:00 2001 From: Jimmy Shih Date: Wed, 14 Dec 2011 14:53:20 -0800 Subject: [PATCH] Fix marker display when the gps location time is 0. If gps is not available, the waypoint marker time is 0. So do not display the time if it is not available. --- .../google/android/apps/mytracks/WaypointsList.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java b/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java index f7dcd02b3..ede45afee 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java +++ b/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java @@ -265,9 +265,13 @@ public class WaypointsList extends ListActivity if (columnIndex == timeIdx) { long time = cursor.getLong(timeIdx); TextView textView = (TextView) view; - textView.setText(String.format("%tc", time)); - textView.setVisibility( - textView.getText().length() < 1 ? View.GONE : View.VISIBLE); + + if (time == 0) { + textView.setVisibility(View.GONE); + } else { + textView.setText(String.format("%tc", time)); + textView.setVisibility(View.VISIBLE); + } } else if (columnIndex == typeIdx) { int type = cursor.getInt(typeIdx); ImageView imageView = (ImageView) view;