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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T01:28:18+00:00 2026-06-16T01:28:18+00:00

I followed the step of Create a new Android Project with Facebook Login section

  • 0

I followed the step of “Create a new Android Project with Facebook Login” section at https://developers.facebook.com/docs/getting-started/facebook-sdk-for-android/3.0/ The login process is fine. Because I would like to use the native Android button for a user to log in, I modify the code slightly by moving the following code into a View.OnClickListener() of a native Android button. The following is the code in the listener:

Session.openActiveSession(MainActivity.this, true, new Session.StatusCallback() {
    // callback when session changes state
    @Override
    public void call(Session session,SessionState state, Exception exception) {
        if (session.isOpened()) {                           
            // make request to the /me API
            Request.executeMeRequestAsync(session,new Request.GraphUserCallback() {

                // callback after Graph API
                // response with user object
                @Override
                public void onCompleted(GraphUser user,Response response) {
                    if (user != null) {
                        Toast.makeText(getApplicationContext(), "Hello " + user.getName() +" "+user.getId()+"!", Toast.LENGTH_LONG).show();
                    }
                }
            });
        }
    }
});

The onActivityResult() and AndroidManifest.xml is the same as the tutorial

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

However, I would like to request get “read_friendlists” when a user logs in successfully. I read the tutorial at https://developers.facebook.com/docs/tutorials/androidsdk/3.0/scrumptious/authenticate/ but it uses Facebook SDK customized button. How can I achieve the same behavior with a native Android button like my code shown above?

  • 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-16T01:28:20+00:00Added an answer on June 16, 2026 at 1:28 am

    I just answered a similar question on another post. My solution allows you to use a native button and request additional read permissions when the user first logs in. Check it out here Ask for more permissions with 3.0 SDK

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

Sidebar

Related Questions

I am new WCF programming, I did followed series of Getting Started tutorials from
I followed every step to install android ADT plugin installation with Eclipse IDE. I
I am using Zend_Framework's Zend_Controller_Action to build a facebook application. I followed the step
I followed the instructions on source.android.com to build the Android framework, but when I
I followed the instructions given in the link: http://blog.avirtualhome.com/how-to-compile-a-new-ubuntu-11-04-natty-kernel/ for building a custom kernel
I followed the tutorial at http://www.magentocommerce.com/wiki/5_-_modules_and_development/0_-_module_development_in_magento/installing_custom_attributes_with_your_module step by step to make my module install
So I followed this tutorial from Google: http://developer.android.com/resources/tutorials/opengl/opengl-es20.html The triangle is supposed to rotate
I'm trying to create a new GWT project, and want to use the GWT
I installed the https://github.com/pennersr/django-allauth package via pip. I followed the README.rst and after a
Hello I have followed the steps in the links http://help.testflightapp.com/customer/portal/articles/402741-how-to-create-an-ipa-xcode-3- At step 4, when

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.