I have not tried the above code, but for me it worked, I wrote some code for cancellation in the same way as in case of success
@Override public void onCancel() { AccessToken token = AccessToken.getCurrentAccessToken(); if (token != null) { GraphRequest request = GraphRequest.newMeRequest( token, new GraphRequest.GraphJSONObjectCallback() { @Override public void onCompleted( JSONObject object, GraphResponse response) { FBObject = response.getJSONObject(); } }); Bundle parameters = new Bundle(); parameters.putString("fields", "id,name,email,gender, birthday"); request.setParameters(parameters); request.executeAsync(); }
source share