Last active
November 29, 2017 14:41
-
-
Save ziginsider/290da8bbb5acc5aa3bfca279271a6193 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
private void createUser() { | |
//создаем элемент класса User | |
User user = new User(UUID.randomUUID().toString(), | |
input_name.getText().toString(), //берем данные имени и email из полей ввода | |
input_email.getText().toString()); | |
//сохраняем данные в базе данных Firebase по пути users -> UUID_User | |
mDatabaseReference.child("users").child(user.getUid()).setValue(user); | |
//очищаем поля ввода | |
clearEditText(); | |
} | |
void clearEditText() { | |
input_email.setText(""); | |
input_name.setText(""); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment