getText в EditText возвращает нулевое значение - PullRequest
0 голосов
/ 07 мая 2020

setText работает нормально, но getText не получает значение

 public View onCreateView(@NonNull LayoutInflater inflater,
                         ViewGroup container, Bundle savedInstanceState) {

    View root = inflater.inflate(R.layout.fragment_home, container, false);


    taskRef = FirebaseDatabase.getInstance().getReference().child("Tasks");
    post_title = (EditText) root.findViewById(R.id.post_task_title);
    post_description = root.findViewById(R.id.post_task_description);
    post_price = root.findViewById(R.id.post_price);
    post_title.setText("hi");

    title = post_title.getText().toString();
    description = post_description.getText().toString();
    price = post_price.getText().toString();
...