How to get FB User ID using Facebook Login Button in android application

android, facebook, facebook-android-sdk

Solution

After successful login, you need to call following code. You can get the logged-in user details with id in response.

Session session = Session.getActiveSession();
Request request = Request.newGraphPathRequest(session, "me", null);
com.facebook.Response response = Request.executeAndWait(request)

Problem

I'm developing an application in which I'm using `Facebook` log in button from SDK. I'm able to get `access_token` of the user but I want `userID` too. I have tried almost everything but was not successful. I have used facebook tutorial for achieving that. Here is the link: Facebook Login Button Please help me in getting `userID` from the same login button. Any kind of help will be appreciated.

Original source