I am trying to share Image and Content via Facebook,but what i am trying is if user is not logged in via Facebook,and user click on Share button then first it should ask for
First time when you try to log in, access token is null. So, it is going on else part. Do this in else part, I think so it may work for you :
LoginManager.getInstance().registerCallback(mcallbackManager, new FacebookCallback()
{
@Override
public void onSuccess(LoginResult loginResult) {
GraphRequest request = GraphRequest.newMeRequest(loginResult.getAccessToken(), new GraphRequest.GraphJSONObjectCallback() {
@Override
public void onCompleted(JSONObject jsonObject, GraphResponse graphResponse) {
}
});
}
});