1

This is my code;

ref.putFile(filePath).addOnCompleteListener(new OnCompleteListener<UploadTask.TaskSnapshot>() {
                @Override
                public void onComplete(@NonNull Task<UploadTask.TaskSnapshot> task) {
                    if(task.isSuccessful())
                    {
                        Toast.makeText(getContext(), "Resim Güncellendi", Toast.LENGTH_LONG).show();
                        String isim=kullaniciİsmi.getText().toString();
                        String egitim =input_egitim.getText().toString();
                        String dogum =input_dogumTarihi.getText().toString();
                        String hakkimda =input_hakkimda.getText().toString();

                        reference = database.getReference().child("Kullanicilar").child(auth.getUid());

                        Map map = new HashMap();
                        map.put("isim", isim);
                        map.put("egitim", egitim);
                        map.put("dogumtarihi", dogum);
                        map.put("hakkimda", hakkimda);
                       map.put("resim",task.getResult().getDowlandUrl().toString());
                        reference.setValue(map).addOnCompleteListener(new OnCompleteListener<Void>() {
                            @Override
                            public void onComplete(@NonNull Task<Void> task) {
                                if(task.isSuccessful()) {
                                    ChangeFragment fragment = new ChangeFragment(getContext());
                                    fragment.change(new KullaniciProfilFragment());
                                    Toast.makeText(getContext(), "Bilgiler Başarıyla Güncellendi", Toast.LENGTH_LONG).show();
                                }
                                else {
                                    Toast.makeText(getContext(), "Bilgiler Güncellenemedi", Toast.LENGTH_LONG).show();
                                }
                            }
                        });
                    }
                    else
                    {
                        Toast.makeText(getContext(), "Resim Güncellenmedi", Toast.LENGTH_LONG).show();
                    }
                }
            });
Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
  • Please do a web search with your error message before posting to Stack Overflow. This is a very common problem due to changes in the API many years ago. – Doug Stevenson Jan 09 '21 at 20:42
  • You also have a typo `getDowlandUrl()` should be `getDowloadUrl()`. But even then, the API changed (over 2½ years ago), so I highly recommend following that question or the examples in the Firebase documentation: https://firebase.google.com/docs/storage/android/download-files#download_data_via_url – Frank van Puffelen Jan 09 '21 at 22:02

0 Answers0