diff --git a/MyTracks/AndroidManifest.xml b/MyTracks/AndroidManifest.xml
index ae51af768..b009e2245 100755
--- a/MyTracks/AndroidManifest.xml
+++ b/MyTracks/AndroidManifest.xml
@@ -112,12 +112,19 @@ limitations under the License.
+
+
+
+
+
diff --git a/MyTracks/res/xml/search.xml b/MyTracks/res/xml/search.xml
index 22c82610d..46ce021ed 100644
--- a/MyTracks/res/xml/search.xml
+++ b/MyTracks/res/xml/search.xml
@@ -5,6 +5,7 @@
android:label="@string/my_tracks_app_name"
android:searchSettingsDescription="@string/search_global_description"
android:voicePromptText="@string/search_voice_prompt"
- android:voiceSearchMode="showVoiceSearchButton|launchRecognizer">
-
-
\ No newline at end of file
+ android:voiceSearchMode="showVoiceSearchButton|launchRecognizer"
+ android:searchSuggestAuthority="com.google.android.maps.mytracks.search"
+ android:searchSuggestThreshold="2"
+ android:searchSuggestSelection=" ? " />
\ No newline at end of file
diff --git a/MyTracks/src/com/google/android/apps/mytracks/SearchActivity.java b/MyTracks/src/com/google/android/apps/mytracks/SearchActivity.java
index 59df27b4a..d2e1eb15e 100644
--- a/MyTracks/src/com/google/android/apps/mytracks/SearchActivity.java
+++ b/MyTracks/src/com/google/android/apps/mytracks/SearchActivity.java
@@ -18,12 +18,13 @@ package com.google.android.apps.mytracks;
import static com.google.android.apps.mytracks.Constants.TAG;
import com.google.android.apps.mytracks.content.SearchEngine;
+import com.google.android.apps.mytracks.content.SearchEngine.ScoredResult;
+import com.google.android.apps.mytracks.content.SearchEngine.SearchQuery;
+import com.google.android.apps.mytracks.content.SearchEngineProvider;
import com.google.android.apps.mytracks.content.Track;
import com.google.android.apps.mytracks.content.TracksColumns;
import com.google.android.apps.mytracks.content.Waypoint;
import com.google.android.apps.mytracks.content.WaypointsColumns;
-import com.google.android.apps.mytracks.content.SearchEngine.ScoredResult;
-import com.google.android.apps.mytracks.content.SearchEngine.SearchQuery;
import com.google.android.maps.mytracks.R;
import android.app.ListActivity;
@@ -34,6 +35,7 @@ import android.location.Location;
import android.location.LocationManager;
import android.net.Uri;
import android.os.Bundle;
+import android.provider.SearchRecentSuggestions;
import android.util.Log;
import android.view.View;
import android.widget.ListView;
@@ -60,11 +62,14 @@ public class SearchActivity extends ListActivity {
private SearchEngine engine;
private LocationManager locationManager;
+ private SearchRecentSuggestions suggestions;
+
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
engine = new SearchEngine(this);
+ suggestions = SearchEngineProvider.newHelper(this);
locationManager = (LocationManager) getSystemService(LOCATION_SERVICE);
handleIntent(getIntent());
@@ -116,6 +121,9 @@ public class SearchActivity extends ListActivity {
showSearchResults(displayResults);
}
});
+
+ // Save the query as a suggestion for the future.
+ suggestions.saveRecentQuery(query.textQuery, null);
}
private List