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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T11:53:49+00:00 2026-06-13T11:53:49+00:00

Possible Duplicate: launch facebook app from other app I am doing one android project,

  • 0

Possible Duplicate:
launch facebook app from other app

I am doing one android project, In that project i need to get Facebook User Details like UserId,AccessToken.

Done Facebook Integration using Fcebook SDK.

Now, Facebook Released URL SCHEME to open facebook application and get user details.

I’m Done like this,

long longFacebookUid = Long.parseLong(facebookUid);
Intent intent = new Intent(Intent.ACTION_VIEW);
intent.setClassName("com.facebook.katana", "com.facebook.katana.ProfileTabHostActivity");
intent.putExtra("extra_user_id", facebookUid);
this.startActivity(intent);
return;

In this code Called Facebook Application, After that i don’t no How to get userId and Token.

Thanks.

  • 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-13T11:53:50+00:00Added an answer on June 13, 2026 at 11:53 am

    Beside URL SCHEME, using the SDK based function is more simple.But it may not be the answer you want.

    Remarks: The following information is based on facebook-android SDK 2.0(3.0 is avaliable now)

    After running the authorize function (Login Part)(The following is sample code in facebook document)

     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() {}
            });
        }
    

    In order to get the access token, just run the following function in SDK 2.0

    String access_token=facebook.getAccessToken();
    

    For the userID

    public String GetUserID(){
        Bundle params = new Bundle();
        params.putString("fields", "id");
        String resp= "";
        try {
            resp = facebook.request("me", params, "GET");//call the request function in SDK 2.0, using graph api
        } catch (FileNotFoundException e) {
        } catch (MalformedURLException e) {
        } catch (IOException e) {
        }
        try{
            resp = new JSONObject(resp).getString("id");
        }catch(JSONException e1){
        }
        }
        return resp;
    };
    

    I think these are the most simply way to get the result, but not using the URL SCHEME.

    I hope it can help you.

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

Sidebar

Related Questions

Possible Duplicate: launch facebook app from other app I'm looking to see if it
Possible Duplicate: launch facebook app from other app Till few days ago, in order
Possible Duplicate: launch facebook app from other app I was wondering if there is
Possible Duplicate: launch facebook app from other app Im a beginner with facebook api
Possible Duplicate: Android Launch an application from another application I am having a problem
Possible Duplicate: Android: How can I get the current foreground activity (from a service)?
Possible Duplicate: I need a good way to get data from a thread to
Possible Duplicate: Launch an app from within another (iPhone) I have designed sample applications
Possible Duplicate: Android Launch an application from another application I want to start Another
Possible Duplicate: Launching application from a SMS message launch an app from a link

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.