Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7850461
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T18:51:42+00:00 2026-06-02T18:51:42+00:00

I want to create a facebook login button for my application. My problem is,

  • 0

I want to create a facebook login button for my application.

My problem is, that I want to call ‘authorize’ with an OnClickListener, but eclipse marks the ‘authorize’ part as an error. It suggests to replace it with authorizeCallback, but it’s not the solution.

It seems like I’m just missing something, but don’t know what. Any idea please?

This is where the error occurs (facebook.authorize):

LoginButton.setOnClickListener(new OnClickListener() 
{
         public void onClick(View v) 
         {
         facebook.authorize(this, new String[] { "email", "user_birthday" }, new FacebookLoginDialogListener());    
          }});
    }

Rest of the code:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) 
{
        super.onActivityResult(requestCode, resultCode, data);
        facebook.authorizeCallback(requestCode, resultCode, data);
}

public class FacebookLoginDialogListener implements DialogListener  
    {
        public void onComplete(Bundle values) {
            SharedPreferences.Editor editor = mPrefs.edit();
            editor.putString("access_token", facebook.getAccessToken());
            editor.putLong("access_expires", facebook.getAccessExpires());
            editor.commit();
            requestUserData(); 
        }

        public void onFacebookError(FacebookError error) {}

        public void onError(DialogError e) {}

        public void onCancel() {}

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T18:51:44+00:00Added an answer on June 2, 2026 at 6:51 pm

    do this way:

    facebook.authorize(YourActivity.this, new String[] { "email", "user_birthday" }, new FacebookLoginDialogListener());
    

    You are passing OnClickListener‘s this reference to the method, You have to pass Activity's Context to the method.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to create an application that will login me with facebook eachtime with
I want to create a login button. When I click it the facebook launches,
I want to create login and password fields same as in facebook app for
I want to create a Facebook app that can operates inside IFrame / FB
I want to create a footer like facebook, that sticks at the bottom of
I want to create a Login through Facebook on a website using Graph API
I am using the Facebook Javascript SDK to create a login button using the
I want to create an application on Facebook, after doing like the tutorial from
I want facebook login in my website For that I followed these steps: 1)Created
I want to create an application in which i want a login logout authentication

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.