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

  • SEARCH
  • Home
  • 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 8747355
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:20:35+00:00 2026-06-13T12:20:35+00:00

I am using this simple code from here: https://developers.facebook.com/docs/mobile/android/build/#sig public class MainActivity extends Activity

  • 0

I am using this simple code from here:

https://developers.facebook.com/docs/mobile/android/build/#sig

public class MainActivity extends Activity {

    Facebook facebook = new Facebook("xxxxxxxxxxxxxx");
    AsyncFacebookRunner mAsyncRunner = new AsyncFacebookRunner(facebook);
    private SharedPreferences mPrefs;

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        mPrefs = getPreferences(MODE_PRIVATE);
        String access_token = mPrefs.getString("access_token", null);
        long expires = mPrefs.getLong("access_expires", 0);
        if (access_token != null) {
            facebook.setAccessToken(access_token);
        }
        if (expires != 0) {
            facebook.setAccessExpires(expires);
        }

        if (!facebook.isSessionValid()) {
            facebook.authorize(this, new String[] {}, new DialogListener() {
                @Override
                public void onComplete(Bundle values) {
                    SharedPreferences.Editor editor = mPrefs.edit();
                    editor.putString("access_token", facebook.getAccessToken());
                    editor.putLong("access_expires",
                            facebook.getAccessExpires());
                    editor.commit();
                }

                @Override
                public void onFacebookError(FacebookError error) {
                }

                @Override
                public void onError(DialogError e) {
                }

                @Override
                public void onCancel() {
                }
            });
        }
    }

    @Override
    public void onActivityResult(int requestCode, int resultCode, Intent data) {
        super.onActivityResult(requestCode, resultCode, data);

        facebook.authorizeCallback(requestCode, resultCode, data);
        try {
            JSONObject json = Util.parseJson(facebook.request("me"));
            String facebookID = json.getString("id");
            String firstName = json.getString("first_name");
            String lastName = json.getString("last_name");
            String email = json.getString("email");
            String gender = json.getString("gender");

        } catch (Exception e) {

            //If i click Okay i get Exception saying You need an Active access token to get the current user details
        }

    }
}

got Hash key using this:

enter image description here

which asks for a password (“android”)

and gives me a code like this:

xLYMxxxxxx/0enePexxf4DORUfR8=

and in facebook application my configurations are:

enter image description here

But i get this Error:

enter image description here

and if i press Okay i get the Exception saying You need an Active access token to get the current user details.

I tried all possible solutions given on SOF. But of no use. Please help

Thank You

  • 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-13T12:20:36+00:00Added an answer on June 13, 2026 at 12:20 pm

    It seems like you didn’t get your hash key correctly from the terminal.

    Try this instead

    1. Enable logging by going to the Facebook SDK source Util.java and set ENABLE_LOG to true.
    2. Try logging into your app again and you should still see the red error message. Press OK.
    3. Go to your logcat and find an entry that looks something like this:

    D/Facebook-authorize(24739): Login failed: invalid_key:Android key mismatch. Your key “uk3udeH7vrOGNFH2FJjdJbdWJWI” does not match the allowed keys specified in your application settings. Check your application settings at http://www.facebook.com/developers

    Copy and paste that key into your dashboard and try again.

    See this SO thread: App is misconfigured for Facebook login : Android Facebook integration issue

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

Sidebar

Related Questions

I try to follow the facebook-android tutorial from here: https://developers.facebook.com/docs/mobile/android/build/#sample I am working in
I followed the tutorial here: https://developers.facebook.com/docs/mobile/android/build/#enablesso I am able to authenticate on the android
I'm using exactly the code in the examples from here: http://code.google.com/apis/picasaweb/docs/1.0/developers_guide_python.html#Auth Still no dice.
i have this simple code to load data from other php page using get
I've been using the sample code from this d3 project to learn how to
I am using this relatively simple code: var height = help ? 'minus' :
I'm using this simple node.js code example but I don't understand why FireBug doesn't
I have this simple code, using Joda-time. Works fine, but I have a problem.
Can anybody help me with this simple code?? #include <iostream> using namespace std; void
This very simple code: #include <iostream> using namespace std; void exec(char* option) { cout

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.