I don\'t know why, but I am always getting null when I try to get the profile picture of the user. Do I need to set some specific permissions to get access?
Below is
new AsyncTask() {
@Override
protected Bitmap doInBackground(String... params) {
Bitmap bitmap = null;
try {
String imageURL = "https://graph.facebook.com/" + mFbUserId +"/picture?width=150&width=150";
URL imageURI = new URL(imageURL);
bitmap = BitmapFactory.decodeStream(imageURI.openConnection().getInputStream());
} catch (Exception e) {
e.printStackTrace();
}
return bitmap;
}
@Override
protected void onPostExecute(Bitmap bitmap) {
super.onPostExecute(bitmap);
}
@Override
protected void onPreExecute() {
super.onPreExecute();
}
}.execute();