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 8232373
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T17:48:56+00:00 2026-06-07T17:48:56+00:00

I am using the facebook sdk to log the user in. I call an

  • 0

I am using the facebook sdk to log the user in.

I call an activity I’ve created that only does the facebook login and should return a result back to the original activity.

Here is how I’m calling this (it’s from the inside of a custom component, that’s why the getContext() is used):

Intent intent = new Intent(getContext(), FacebookAuthenticationActivity.class);
Log.d(TAG, "Starting facebook authentication for result");
((Activity)getContext()).startActivityForResult(intent, REQUEST_FACEBOOK);

And here I want the response:

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent intent) {
    Log.d(TAG, "Result from something!");
    if(requestCode == LoginWidget.REQUEST_FACEBOOK) {
        if(resultCode == RESULT_OK && intent != null) {
            Log.d(TAG, "Result from facebook received!");
            mLoginWidget.onFacebookLoginSucceeded(intent);
        }
    }
    super.onActivityResult(requestCode, resultCode, intent);
}

On the facebook activity, it’s the code from the facebook developers page. There is no error in that code… For some weird reason the activity calls the onActivityResult before he calls the onCreate on the FacebookAuthActivity.

The coode I’ve written is to log the user in, get some info and finally call:

Intent intent = new Intent();
intent.putExtra("user_json", response);

Log.d(TAG, "Setting result to: " + intent);
setResult(RESULT_OK, intent);
finish();

After reviewing the logs here is what I get:

07-11 16:34:27.992: D/LoginWidget(6863): Starting facebook authentication for result
07-11 16:34:27.992: D/ProgramActivity(6863): I am starting an activity to get a result!
07-11 16:34:28.101: D/ProgramActivity(6863): Result from something!
07-11 16:34:40.875: D/Facebook-authorize(6863): Login Success! access_token=xxx expires=1347195352881
07-11 16:34:40.875: D/FacebookAuthentication(6863): User accepted our app in facebook!
07-11 16:34:42.351: D/FacebookAuthentication(6863): Setting result to: Intent { (has extras) }

So I am out of ideas… For some reason when I call this activity it immediately calls onActivityResult on the parent without the result, then after that, it logs in, sets the real result, calls finish, and never calls onActivityResult with the real response.

Am I missing something here? Do I have to set a specific flag for this activity to correctly return me the result?

It’s just a simple activity with a bunch of async facebook calls and then calls back with the result…

UPDATE

Just to be clearer, I do not get any errors from this code. The problem is that when I set the result, after the login, the originating activity does not receive the result.

  • 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-07T17:48:58+00:00Added an answer on June 7, 2026 at 5:48 pm

    The answer is here. This “feature” does not allow activities started using singleInstace to call activities for results.

    I changed my activity to singleTop and it now works as it should work.

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

Sidebar

Related Questions

I'm using the Facebook C# SDK to allow users to log in to my
Using the PHP sdk I'm signing users into my site with Facebook log in.
I am using Facebook SDK in hackbook and tried to login and do all
I am using facebook PHP SDK. After the user allows my application, facebook redirects
In my Android app, I log in using the Facebook SDK and display posts
I'm attempting to log a user out of facebook with the Facebook JS SDK,
i have implemented facebook log in using Facebook javascript SDK in Jquery mobile ,
I am using Facebook PHP SDK to authenticate the user. After generating the LoginUrl
I am using the Facebook PHP sdk, and after the user logs in, I
The facebook login using the Facebook C# SDK was working, but now is not!

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.