I am working on a dialog box. When I click a button it should open a dialog box with a Facebook profile image. How can I achieve this? Below is my dialog box.
final Dialog dialog = new Dialog(context);
dialog.setContentView(R.layout.customdailog);
ImageView image = (ImageView) dialog.findViewById(R.id.imageView2);
image.setImageResource(R.drawable.fb);
Button dialogButton = (Button) dialog.findViewById(R.id.fbshare);
dialogButton.setOnClickListener(new OnClickListener() {
public void onClick(View v) {
dialog.dismiss();
}
});
dialog.show();
break;
}
Look at official Android Facebook SDK at github
Also user profile picture is public, this means that authorization isn’t requared and you can just load user page URL, parse the body of the response and get the image