diff --git a/MyTracks/res/layout/mytracks_send_to_google.xml b/MyTracks/res/layout/mytracks_send_to_google.xml
index e0ead4c75..b9ae00f2c 100644
--- a/MyTracks/res/layout/mytracks_send_to_google.xml
+++ b/MyTracks/res/layout/mytracks_send_to_google.xml
@@ -127,26 +127,24 @@ limitations under the License.
+ android:layout_height="wrap_content"
+ android:layout_width="fill_parent"
+ android:orientation="horizontal"
+ android:paddingLeft="2dip"
+ android:paddingRight="2dip"
+ android:paddingTop="4dip">
+
+
-
+ style="@style/DialogButton"/>
+ style="@style/DialogButton"/>
+
+
diff --git a/MyTracks/res/values/styles.xml b/MyTracks/res/values/styles.xml
index 54287366c..0eca32c08 100644
--- a/MyTracks/res/values/styles.xml
+++ b/MyTracks/res/values/styles.xml
@@ -85,4 +85,22 @@ limitations under the License.
+
+
+
+
+
+
\ No newline at end of file
diff --git a/MyTracks/src/com/google/android/apps/mytracks/services/TrackRecordingService.java b/MyTracks/src/com/google/android/apps/mytracks/services/TrackRecordingService.java
index ee63dca09..a0f2010ee 100644
--- a/MyTracks/src/com/google/android/apps/mytracks/services/TrackRecordingService.java
+++ b/MyTracks/src/com/google/android/apps/mytracks/services/TrackRecordingService.java
@@ -153,6 +153,9 @@ public class TrackRecordingService extends Service {
@Override
public void onLocationChanged(final Location location) {
+ if (executorService.isShutdown() || executorService.isTerminated()) {
+ return;
+ }
executorService.submit(
new Runnable() {
@Override
@@ -342,7 +345,6 @@ public class TrackRecordingService extends Service {
timer.purge();
unregisterLocationListener();
shutdownTaskExecutors();
- executorService.shutdown();
if (sensorManager != null) {
sensorManager.shutdown();
sensorManager = null;
@@ -358,6 +360,8 @@ public class TrackRecordingService extends Service {
// This should be the last operation.
releaseWakeLock();
+ // Shutdown the executor service last to avoid sending events to a dead executor.
+ executorService.shutdown();
super.onDestroy();
}