diff --git a/MyTracks/res/menu/search_only.xml b/MyTracks/res/menu/search_only.xml index ccf072255..44cd456e8 100644 --- a/MyTracks/res/menu/search_only.xml +++ b/MyTracks/res/menu/search_only.xml @@ -15,12 +15,9 @@ See the License for the specific language governing permissions and limitations under the License. -->
\ No newline at end of file diff --git a/MyTracks/src/com/google/android/apps/mytracks/TrackList.java b/MyTracks/src/com/google/android/apps/mytracks/TrackList.java index 14971c751..9dc6f773b 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/TrackList.java +++ b/MyTracks/src/com/google/android/apps/mytracks/TrackList.java @@ -324,6 +324,17 @@ public class TrackList extends ListActivity getMenuInflater().inflate(R.menu.search_only, menu); return true; } + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.menu_search: + onSearchRequested(); + return true; + default: + return super.onOptionsItemSelected(item); + } + } @Override protected Dialog onCreateDialog(int id) { @@ -389,11 +400,6 @@ public class TrackList extends ListActivity } } - /* Callback from menu/search_only.xml */ - public void onSearch(@SuppressWarnings("unused") MenuItem i) { - onSearchRequested(); - } - private void updateButtonsEnabled() { View deleteAll = findViewById(R.id.tracklist_btn_delete_all); View exportAll = findViewById(R.id.tracklist_btn_export_all); diff --git a/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java b/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java index 08819ffa2..85bc8993b 100644 --- a/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java +++ b/MyTracks/src/com/google/android/apps/mytracks/WaypointsList.java @@ -224,10 +224,16 @@ public class WaypointsList extends ListActivity implements View.OnClickListener getMenuInflater().inflate(R.menu.search_only, menu); return true; } - - /* Callback from menu/search_only.xml */ - public void onSearch(@SuppressWarnings("unused") MenuItem i) { - onSearchRequested(); + + @Override + public boolean onOptionsItemSelected(MenuItem item) { + switch (item.getItemId()) { + case R.id.menu_search: + onSearchRequested(); + return true; + default: + return super.onOptionsItemSelected(item); + } } @Override