diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/com/android/stk/StkInputActivity.java | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/com/android/stk/StkInputActivity.java b/src/com/android/stk/StkInputActivity.java index fe16101..0af6767 100644 --- a/src/com/android/stk/StkInputActivity.java +++ b/src/com/android/stk/StkInputActivity.java @@ -105,18 +105,22 @@ public class StkInputActivity extends AppCompatActivity implements View.OnClickL return; } - if (v.getId() == R.id.button_ok) { + switch (v.getId()) { + case R.id.button_ok: input = mTextIn.getText().toString(); - } else if (v.getId() == R.id.button_cancel) { + break; + case R.id.button_cancel: sendResponse(StkAppService.RES_ID_END_SESSION); finish(); return; - // Yes/No layout buttons. - } else if (v.getId() == R.id.button_yes) { + // Yes/No layout buttons. + case R.id.button_yes: input = YES_STR_RESPONSE; - } else if (v.getId() == R.id.button_no) { + break; + case R.id.button_no: input = NO_STR_RESPONSE; - } else if (v.getId() == R.id.more) { + break; + case R.id.more: if (mPopupMenu == null) { mPopupMenu = new PopupMenu(this, v); Menu menu = mPopupMenu.getMenu(); @@ -136,6 +140,8 @@ public class StkInputActivity extends AppCompatActivity implements View.OnClickL mPopupMenu.show(); } return; + default: + break; } CatLog.d(LOG_TAG, "handleClick, ready to response"); sendResponse(StkAppService.RES_ID_INPUT, input, false); |