Beispiel #1
0
 public boolean onKeyDown(int keyCode) {
   if (keyCode == KeyEvent.KEYCODE_BACK) {
     view.hideKeyBoard();
     if (view.isDoneMenuItemVisible()) {
       view.showNotSaveNoteDialog();
       return true;
     }
   }
   return false;
 }
Beispiel #2
0
 public boolean onOptionsItemSelected(MenuItem item) {
   switch (item.getItemId()) {
     case R.id.done:
       saveNote();
       return true;
     case android.R.id.home:
       view.hideKeyBoard();
       if (view.isDoneMenuItemVisible()) {
         view.showNotSaveNoteDialog();
         return true;
       }
       view.finishView();
     default:
       return false;
   }
 }