Saim Mahmood
Saim Mahmood

Reputation: 446

Cannot set facebook profile picture to an Imageview

I have a problem when I am trying to retrieve the Facebook profile picture of a person through his/her user ID.

The user ID that i get I then try to set it up using a FacebookProfilePictureView which sets up until I put it into a table which then becomes null and shows me a blank space.

The same is the case with ImageView. When I try to set the ImageView using a Bitmap it just doesnt return anything, shows me a blank space whatever I do. I have tried around 3-4 links of SO that have implemented different functions to solve this problem but this just doesnt work for me.

What is really happening in my code ...

First, when I login through facebook, it saves my name, my userID and some other data and stores it into a PHP database. This happens in the HomePage of my app. Then when I move to another page where it retrieves the same link from the same PHP database and tries to set up the ImageView using this ID.

For some reason, this method always returns null no matter what I do. Also, if it helps, the URL which I recieve is of this format:

https:\/\/fb-s-d-a.akamaihd.net\/h-ak-xpt1\/v\/t1.0-1\/p50x50\/

Any help would be appreciated ... :)

Upvotes: 1

Views: 70

Answers (1)

Ali Nasir
Ali Nasir

Reputation: 217

The link has some weirdly placed forward brackets, did you try changing them to a backslash?

https://fb-s-d-a.akamaihd.net/h-ak-xpt1/v/t1.0-1/p50x50/

The forward brackets are removed in the above link. What our browser does is that it auromatically detects this forward slash thing and it converts it to the type I have shown above.

Try it out it might work

Upvotes: 1

Related Questions