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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:10:41+00:00 2026-06-02T13:10:41+00:00

I aneed to do login with facebok, for that reason i downloaded sdk and

  • 0

I aneed to do login with facebok, for that reason i downloaded sdk and created my method.

After i get info that user is logged i need to send this to my web service and do callback to my activity.

Here is the code i have. onComplete i tried to explain what i need:
Well basically i need callback to my current activity.

public class DisplayLoginActivity extends FragmentActivity {



    /** Called when the activity is first created. */
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        // TODO Auto-generated method stub
        super.onCreate(savedInstanceState);
        setContentView(R.layout.display_login_activity);

        login();
    }

    public void login(){
        facebook = new Facebook(kAppId);

        facebook.authorize(this, new DialogListener() {

            @Override
            public void onComplete(Bundle values) {
                System.out.println("onComplete");
                        JSONObject me = null;
                        me = new JSONObject(facebook.request("me"));                

                        String id = me.getString("id");     

                        //I want here to call other async request and make it call back to DisplayLoginActivity, for that
                        //reason i created callback with interface so i need to give this of my Activity
                        //If i give this so it's DialogListener this. I tried to do this DisplayLoginActivity.this but it crashes
            }


            @Override
            public void onFacebookError(FacebookError error) {
                error.getMessage();

            }

            @Override
            public void onError(DialogError e) {

            }

            @Override
            public void onCancel() {

            }

        });
    }

}

Maybe you have some ideas ?
Thanks.

Edit:

04-20 08:34:50.270: E/AndroidRuntime(7642): FATAL EXCEPTION: Thread-10
04-20 08:34:50.270: E/AndroidRuntime(7642): java.lang.ExceptionInInitializerError
04-20 08:34:50.270: E/AndroidRuntime(7642):     at com.my.main.DisplayLoginActivity$1$1.run(DisplayLoginActivity.java:161)
04-20 08:34:50.270: E/AndroidRuntime(7642):     at java.lang.Thread.run(Thread.java:1019)
04-20 08:34:50.270: E/AndroidRuntime(7642): Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare()
04-20 08:34:50.270: E/AndroidRuntime(7642):     at android.os.Handler.<init>(Handler.java:121)
04-20 08:34:50.270: E/AndroidRuntime(7642):     at android.os.AsyncTask$InternalHandler.<init>(AsyncTask.java:421)
04-20 08:34:50.270: E/AndroidRuntime(7642):     at android.os.AsyncTask$InternalHandler.<init>(AsyncTask.java:421)
04-20 08:34:50.270: E/AndroidRuntime(7642):     at android.os.AsyncTask.<clinit>(AsyncTask.java:152)
04-20 08:34:50.270: E/AndroidRuntime(7642):     ... 2 more
  • 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-02T13:10:47+00:00Added an answer on June 2, 2026 at 1:10 pm

    I’m not familiar with the Facebook API, but have you tried simply calling Looper.prepare() in the function(s) that run on a separate thread (in this case, onComplete())? It should be the first function call in the thread.

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

Sidebar

Related Questions

I need to define a static property or method in certain classes of my
Have a need for a sql query which will do cloning of Oracle user.
I have a need to display some basic info about a facebook group on
I have a method in my business logic layer that accepts a stream, which
I have a need for methods in several classes that must always follow a
I have a need to push out a file package that includes a driver
I have a need to create a user table type. My preference is to
Developing a project of mine I realize I have a need for some level
I have a need for a model(?) on my app which basically contains a
I've had a need to create an encrypted volume on my mac for the

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.