forked from upstream-mirrors/OpenTracks
Merging from head
This commit is contained in:
@@ -1,8 +1,8 @@
|
|||||||
<?xml version="1.0" encoding="utf-8"?>
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
|
||||||
package="com.google.android.maps.mytracks"
|
package="com.google.android.maps.mytracks"
|
||||||
android:versionCode="16"
|
android:versionCode="17"
|
||||||
android:versionName="1.0.15">
|
android:versionName="1.0.16">
|
||||||
<application android:icon="@drawable/arrow_icon"
|
<application android:icon="@drawable/arrow_icon"
|
||||||
android:label="@string/app_name"
|
android:label="@string/app_name"
|
||||||
android:backupAgent="com.google.android.apps.mytracks.io.backup.MyTracksBackupAgentHelper">
|
android:backupAgent="com.google.android.apps.mytracks.io.backup.MyTracksBackupAgentHelper">
|
||||||
|
|||||||
@@ -114,7 +114,7 @@ public class MyMapsGDataWrapper {
|
|||||||
} catch (HttpException e) {
|
} catch (HttpException e) {
|
||||||
Log.e(MyTracksConstants.TAG, "HttpException", e);
|
Log.e(MyTracksConstants.TAG, "HttpException", e);
|
||||||
errorMessage = e.getMessage();
|
errorMessage = e.getMessage();
|
||||||
if (errorMessage.contains("401")) {
|
if (errorMessage != null && errorMessage.contains("401")) {
|
||||||
errorType = ERROR_AUTH;
|
errorType = ERROR_AUTH;
|
||||||
} else {
|
} else {
|
||||||
errorType = ERROR_CONNECTION;
|
errorType = ERROR_CONNECTION;
|
||||||
@@ -122,7 +122,7 @@ public class MyMapsGDataWrapper {
|
|||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
Log.e(MyTracksConstants.TAG, "Exception", e);
|
Log.e(MyTracksConstants.TAG, "Exception", e);
|
||||||
errorMessage = e.getMessage();
|
errorMessage = e.getMessage();
|
||||||
if (errorMessage.contains("503")) {
|
if (errorMessage != null && errorMessage.contains("503")) {
|
||||||
errorType = ERROR_INTERNAL;
|
errorType = ERROR_INTERNAL;
|
||||||
} else {
|
} else {
|
||||||
errorType = ERROR_CONNECTION;
|
errorType = ERROR_CONNECTION;
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
/*
|
/*
|
||||||
* Copyright 2008 Google Inc.
|
* Copyright 2008 Google Inc.
|
||||||
*
|
*
|
||||||
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
* Licensed under the Apache License, Version 2.0 (the "License"); you may not
|
||||||
* use this file except in compliance with the License. You may obtain a copy of
|
* use this file except in compliance with the License. You may obtain a copy of
|
||||||
* the License at
|
* the License at
|
||||||
*
|
*
|
||||||
* http://www.apache.org/licenses/LICENSE-2.0
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
*
|
*
|
||||||
* Unless required by applicable law or agreed to in writing, software
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
||||||
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
||||||
@@ -131,15 +131,15 @@ public class MyTracksOverlay extends Overlay {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Add a location to the map overlay.
|
* Add a location to the map overlay.
|
||||||
*
|
*
|
||||||
* NOTE: this method takes ownership of this location and may change it.
|
* NOTE: this method takes ownership of this location and may change it.
|
||||||
*
|
*
|
||||||
* @param l the location to add
|
* @param l the location to add
|
||||||
*/
|
*/
|
||||||
public void addLocation(Location l) {
|
public void addLocation(Location l) {
|
||||||
points.add(l);
|
points.add(l);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addWaypoint(Waypoint wpt) {
|
public void addWaypoint(Waypoint wpt) {
|
||||||
waypoints.add(wpt);
|
waypoints.add(wpt);
|
||||||
}
|
}
|
||||||
@@ -170,6 +170,9 @@ public class MyTracksOverlay extends Overlay {
|
|||||||
ArrayList<Waypoint> currentWaypoints = waypoints;
|
ArrayList<Waypoint> currentWaypoints = waypoints;
|
||||||
for (int i = 1; i < currentWaypoints.size(); i++) {
|
for (int i = 1; i < currentWaypoints.size(); i++) {
|
||||||
Waypoint wpt = currentWaypoints.get(i);
|
Waypoint wpt = currentWaypoints.get(i);
|
||||||
|
if (wpt == null) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
Location loc = wpt.getLocation();
|
Location loc = wpt.getLocation();
|
||||||
if (loc == null) {
|
if (loc == null) {
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
@@ -19,12 +19,17 @@ import com.google.android.maps.mytracks.R;
|
|||||||
|
|
||||||
import android.app.Activity;
|
import android.app.Activity;
|
||||||
import android.app.AlertDialog;
|
import android.app.AlertDialog;
|
||||||
|
import android.content.pm.PackageInfo;
|
||||||
|
import android.content.pm.PackageManager;
|
||||||
|
import android.content.pm.PackageManager.NameNotFoundException;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
|
import android.util.Log;
|
||||||
import android.view.LayoutInflater;
|
import android.view.LayoutInflater;
|
||||||
import android.view.View;
|
import android.view.View;
|
||||||
import android.view.View.OnClickListener;
|
import android.view.View.OnClickListener;
|
||||||
import android.view.Window;
|
import android.view.Window;
|
||||||
import android.webkit.WebView;
|
import android.webkit.WebView;
|
||||||
|
import android.widget.TextView;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An activity that displays a welcome screen.
|
* An activity that displays a welcome screen.
|
||||||
@@ -72,5 +77,16 @@ public class WelcomeActivity extends Activity {
|
|||||||
builder.setIcon(R.drawable.arrow_icon);
|
builder.setIcon(R.drawable.arrow_icon);
|
||||||
AlertDialog dialog = builder.create();
|
AlertDialog dialog = builder.create();
|
||||||
dialog.show();
|
dialog.show();
|
||||||
|
|
||||||
|
// Get the version from the manifest.
|
||||||
|
try {
|
||||||
|
PackageInfo pi =
|
||||||
|
getPackageManager().getPackageInfo("com.google.android.maps.mytracks",
|
||||||
|
PackageManager.GET_META_DATA);
|
||||||
|
((TextView) dialog.findViewById(R.id.about_version_register)).
|
||||||
|
setText(pi.versionName);
|
||||||
|
} catch (NameNotFoundException e) {
|
||||||
|
Log.w(MyTracksConstants.TAG, "Failed to get version info.", e);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user