Last active
November 29, 2017 14:28
-
-
Save ziginsider/9f311e54f0fae1634c6bbdc886af70d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @Override | |
| public boolean onOptionsItemSelected(MenuItem item) { | |
| //нажато "добавить" | |
| if (item.getItemId() == R.id.menu_add) { | |
| createUser(); | |
| } | |
| //нажато "сохранить изменения" | |
| else if (item.getItemId() == R.id.menu_save) { | |
| //создаем экземпляр записи и заносим туда измененные данные | |
| //которые берем из полей ввода | |
| User user = new User(selectedUser.getUid(), | |
| input_name.getText().toString(), | |
| input_email.getText().toString()); | |
| //записываем измененные данные | |
| updateUser(user); | |
| } | |
| //нажато "удалить запись" | |
| else if (item.getItemId() == R.id.menu_remove) { | |
| //удаляем выбранную запись | |
| deleteUser(selectedUser); | |
| } | |
| return true; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment