title: Display user's Facebook profile pic xamarin.forms Android
body: <p>I am trying to display user's facebook profile picture. I have a working FacebookRenderer in my android project. I just need some guidelines on how to display the actual image. Below is my attempt on what I've tried but picture does not display. Any help will be appreciated. </p>
  
  <p>I basically created a renderer for the Facebook Login in my android project and user details are saved and passed to the PCL using the Settings plugin(allowing my user's info to be saved in static variable)
  <strong>FacebookRenderer:</strong></p>
  
  <pre><code> public class FacebookRender : PageRenderer
      {
          public FacebookRender()
          {
              String error;
              var activity = this.Context as Activity;
  
              var auth = new OAuth2Authenticator(
                  clientId: "",
                  scope: "email",
                  authorizeUrl: new Uri("https://www.facebook.com/dialog/oauth/"),
                  redirectUrl: new Uri("https://www.facebook.com/connect/login_success.html")
                  );
  
              auth.Completed += async (sender, eventArgs) =&gt;
                  {
                      try
                      {
                          if (eventArgs.IsAuthenticated)
                          {
                              await AccountStore.Create().SaveAsync(eventArgs.Account, "FacebookProviderKey");
  
                              var accessToken = eventArgs.Account.Properties["access_token"].ToString();
                              var expiresIn = Convert.ToDouble(eventArgs.Account.Properties["expires_in"]);
                              var expiryDate = DateTime.Now + TimeSpan.FromSeconds(expiresIn);
  
                              var request = new OAuth2Request("GET", new Uri("https://graph.facebook.com/me?fields=email,first_name,last_name,gender,picture"), null, eventArgs.Account);
                              var response = await request.GetResponseAsync();
                              var obj = JObject.Parse(response.GetResponseText());
  
                              var id = obj["id"].ToString().Replace("\"", "");
                              var name = obj["first_name"].ToString().Replace("\"", "");
                              var surname = obj["last_name"].ToString().Replace("\"", "");
                              var gender = obj["gender"].ToString().Replace("\"", "");
                              var email = obj["email"].ToString().Replace("\"", "");
                              var profilePic = obj["picture"].ToString().Replace("\"", "");
  
  
                              Customer.Customers cust = new Customer.Customers();
                              cust.Number = "";
                              cust.Name = name;
                              cust.Surname = surname;
                              cust.Address = " ";
                              cust.Email = email;
                              cust.City = " ";
                              cust.Region = " ";
                              cust.Country = " ";
                              cust.MobilePhone = " ";
                              cust.DOB = DateTime.Now;
                              cust.Phone = " ";
                              cust.Credentials = new Customer.Credentials();
                              cust.Credentials.Authenticated = true;
                              cust.Credentials.SecretKey = "73fnfdbjfdj";
                              cust.DeviceToken = GcmService.RegistrationID;
  
                              Helpers.Settings.picture = profilePic;
  
  
                              CustomerService service = new CustomerService();
                              Settings.Token = await service.AddCustomer(cust);
  
                              Helpers.Settings.Usertoken = Settings.Token;
  
                              if (Helpers.Settings.MobileNo == null || Helpers.Settings.MobileNo == " ")
                              {
                                  await App.NavigateToSMS();
  
                              }
                              else
                              {
                                  App.NavigateToVerified();
                              }
                          }
                          else
                          {
                              App.NavigateToProfile();
                          }
                      }
                      catch(Exception ex)
                      {
                          error = ex.Message;
                      }
                  };
              activity.StartActivity(auth.GetUI(activity));
          }
  </code></pre>
  
  <p><strong>Xaml</strong></p>
  
  <pre><code>&lt;StackLayout Orientation="Horizontal"  HorizontalOptions="Center" VerticalOptions="CenterAndExpand"&gt;
                      &lt;StackLayout Orientation="Vertical"  HorizontalOptions="Center"&gt;
                          &lt;Image x:Name="profilePic" HeightRequest="30" WidthRequest="30"/&gt;
                      &lt;/StackLayout&gt;
                      &lt;StackLayout Orientation="Vertical"  HorizontalOptions="CenterAndExpand" VerticalOptions="CenterAndExpand"&gt;
                          &lt;Label x:Name="lblMessage" FontSize="Medium" HorizontalOptions="Center" TextColor="White" VerticalOptions="CenterAndExpand"  /&gt;
                      &lt;/StackLayout&gt;
                  &lt;/StackLayout&gt;
  </code></pre>
  
  <p><strong>Xaml.cs</strong></p>
  
  <pre><code>profilePic.Source = Helpers.Settings.picture;
  </code></pre>