Fixing menu items.

The complicated bit that was missing was the delete action, which is now its own activity with proper intent handling.
This commit is contained in:
Rodrigo Damazio
2011-08-19 01:33:46 -03:00
parent 657ec17559
commit 496ad9c4e2
10 changed files with 203 additions and 125 deletions
@@ -1,12 +1,12 @@
/*
* Copyright 2010 Google Inc.
*
*
* 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
* the License at
*
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
@@ -24,7 +24,7 @@ import android.view.MenuItem;
/**
* Manage the application menus.
*
*
* @author Sandor Dornbush
*/
class MenuManager {
@@ -34,7 +34,7 @@ class MenuManager {
public MenuManager(MyTracks activity) {
this.activity = activity;
}
public boolean onCreateOptionsMenu(Menu menu) {
activity.getMenuInflater().inflate(R.menu.main, menu);
return true;
@@ -52,7 +52,7 @@ class MenuManager {
.setEnabled(isRecording)
.setVisible(isRecording);
}
public boolean onOptionsItemSelected(MenuItem item) {
switch (item.getItemId()) {
case R.id.menu_start_recording: {
@@ -86,10 +86,6 @@ class MenuManager {
case R.id.menu_help: {
return startActivity(WelcomeActivity.class);
}
case Constants.MENU_CLEAR_MAP: {
activity.clearSelectedTrack();
return true;
}
}
return false;
}