Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
390 views
in Technique[技术] by (71.8m points)

android - Profile image not showing after saving(it just shows blank white screen)

I am trying to upload user profile image and store in firebase.My image successfully stores in firebase storage and in the user database.

When I upload the image it shows on my screen,but once I save and reopen the settings to see the profile image,it does not show,it just shows blank white screen(but the name and phone show when reopened,only image does not show)

I have attached the code that gets value from db and shows in ui and also added the saveUserInformation() which is called when the user clicks the save image button and this function saves name,phone and profileimage in db. I have added screenshot of database below and also added the snippet of error I am getting.

What am I doing wrong?

This is what glide outputs when i console logged it : profile img here:Target for: android.support.v7.widget.AppCompatImageView{528bbb2 V.ED..C.. ......ID 0,0-300,300 #7f0a00b9 app:id/profileImage}[CDS]rx timeout:0

 mCustomerDatabase.addValueEventListener(object :ValueEventListener{
            override fun onDataChange(dataSnapshot: DataSnapshot) {
                if(dataSnapshot.exists() && dataSnapshot.childrenCount>0){
                    val map:Map<*,*> = dataSnapshot.value as Map<*,*>
                    if(map["name"] !=null){
                        mName=map["name"].toString()
                        mNameField.setText(mName)
                    }
                    if(map["phone"]!=null){
                        mPhone=map["phone"].toString()
                        mPhoneField.setText(mPhone)
                    }
                    if(map["profileImageUrl"]!=null){
                        mProfileImageUrl=map["profileImageUrl"].toString()

                        Glide.with(applicationContext).load(mProfileImageUrl).into(mProfileImage)
                        val a=Glide.with(applicationContext).load(mProfileImageUrl).into(mProfileImage)

                        print("profile img here:$a")

                    }

                }

            }

            override fun onCancelled(p0: DatabaseError) {
                TODO("not implemented") //To change body of created functions use File | Settings | File Templates.
            }
        })
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
Waitting for answers

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...