summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/com/android/emergency/edit/EditInfoActivity.java19
-rw-r--r--src/com/android/emergency/view/ViewInfoActivity.java19
2 files changed, 18 insertions, 20 deletions
diff --git a/src/com/android/emergency/edit/EditInfoActivity.java b/src/com/android/emergency/edit/EditInfoActivity.java
index 8f19692e..7a6a01b8 100644
--- a/src/com/android/emergency/edit/EditInfoActivity.java
+++ b/src/com/android/emergency/edit/EditInfoActivity.java
@@ -92,16 +92,15 @@ public class EditInfoActivity extends Activity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case android.R.id.home:
- // The user asked to navigate up, which, in this case, can easily be accomplished
- // by finishing the activity.
- finish();
- return true;
-
- case R.id.action_clear_all:
- showClearAllDialog();
- return true;
+ int itemId = item.getItemId();
+ if (itemId == android.R.id.home) {
+ // The user asked to navigate up, which, in this case, can easily be accomplished
+ // by finishing the activity.
+ finish();
+ return true;
+ } else if (itemId == R.id.action_clear_all) {
+ showClearAllDialog();
+ return true;
}
return super.onOptionsItemSelected(item);
}
diff --git a/src/com/android/emergency/view/ViewInfoActivity.java b/src/com/android/emergency/view/ViewInfoActivity.java
index dcf34cba..30bcae36 100644
--- a/src/com/android/emergency/view/ViewInfoActivity.java
+++ b/src/com/android/emergency/view/ViewInfoActivity.java
@@ -154,16 +154,15 @@ public class ViewInfoActivity extends FragmentActivity {
@Override
public boolean onOptionsItemSelected(MenuItem item) {
- switch (item.getItemId()) {
- case android.R.id.home:
- onBackPressed();
- return true;
-
- case R.id.action_edit:
- Intent intent = new Intent(this, EditInfoActivity.class);
- intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
- startActivity(intent);
- return true;
+ int itemId = item.getItemId();
+ if (itemId == android.R.id.home) {
+ onBackPressed();
+ return true;
+ } else if (itemId == R.id.action_edit) {
+ Intent intent = new Intent(this, EditInfoActivity.class);
+ intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
+ startActivity(intent);
+ return true;
}
return super.onOptionsItemSelected(item);
}