N
N
NOnames_ru2020-04-16 23:49:35
Java
NOnames_ru, 2020-04-16 23:49:35

Why is the image not displayed from Storage Firebase?

Why, when I register a user via phone using firebase, the image is shown for a while, then not???
My guess is that I am not authorizing the user correctly.

Here is the output code.

firebaseFirestore.collection("users").document(user_id).get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
                @Override
                public void onComplete(@NonNull Task<DocumentSnapshot> task) {
                    if (task.isSuccessful()) {
                        if(task.getResult().exists()){
                            sub_btn.setEnabled(true);
                            sub_btn.setVisibility(View.GONE);
                            cansel_sub_btn.setEnabled(true);
                            cansel_sub_btn.setVisibility(View.GONE);
                            edit_btn.setVisibility(View.VISIBLE);
                            edit_btn.setEnabled(false);
                            String name = task.getResult().getString("name");
                            String surname = task.getResult().getString("surname");
                            String full_name_text = name + " " + surname;
                            String username_text = task.getResult().getString("username");
                            String avatar = task.getResult().getString("avatar");

                            full_name.setText(full_name_text);
                            username.setText(username_text);

                            edit_btn.setVisibility(View.VISIBLE);
                            sub_btn.setVisibility(View.GONE);
                            username.setText(username_text);

                            RequestOptions placeholderReqFull = new RequestOptions();
                            placeholderReqFull.placeholder(R.drawable.defult_profile_icon);
                            Glide.with(ProfileActivity.this).setDefaultRequestOptions(placeholderReqFull).load(avatar).into(full_image);

                            RequestOptions placeholderReq = new RequestOptions();
                            placeholderReq.placeholder(R.drawable.defult_profile_icon);
                            Glide.with(ProfileActivity.this).setDefaultRequestOptions(placeholderReq).load(avatar).into(imageAvtar);
                        }

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question