Skip to content

Instantly share code, notes, and snippets.

@ziginsider
Last active November 29, 2017 14:41
Show Gist options
  • Save ziginsider/290da8bbb5acc5aa3bfca279271a6193 to your computer and use it in GitHub Desktop.
Save ziginsider/290da8bbb5acc5aa3bfca279271a6193 to your computer and use it in GitHub Desktop.
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