Skip to content

Instantly share code, notes, and snippets.

@ziginsider
Last active November 20, 2017 13:05
Show Gist options
  • Select an option

  • Save ziginsider/c3b8b3410ec7b6fb17f842b5c6f10f19 to your computer and use it in GitHub Desktop.

Select an option

Save ziginsider/c3b8b3410ec7b6fb17f842b5c6f10f19 to your computer and use it in GitHub Desktop.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
//printKeyHash();
callbackManager = CallbackManager.Factory.create();
txtBirthday = (TextView) findViewById(R.id.txt_birthday);
txtEmail = (TextView) findViewById(R.id.txt_email);
txtFriends = (TextView) findViewById(R.id.txt_friends);
txtLocation = (TextView) findViewById(R.id.txt_locale);
imgAvatar = (ImageView) findViewById(R.id.avatar);
LoginButton loginButton = (LoginButton) findViewById(R.id.login_button);
loginButton.setReadPermissions(Arrays.asList("public_profile",
"email",
"user_location",
"user_birthday",
"user_friends"));
loginButton.registerCallback(callbackManager, new FacebookCallback<LoginResult>() {
@Override
public void onSuccess(LoginResult loginResult) {
}
@Override
public void onCancel() {
}
@Override
public void onError(FacebookException error) {
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment