Lets say I sign in from class Login
, using gdxFacebook = GDXFacebookSystem.install(config);
and gdxFacebook.signIn
. I can then call GDXFacebookGraphRequest request = new GDXFacebookGraphRequest().setNode("me").useCurrentAccessToken();
without any issues.
However, when I try to use GDXFacebookGraphRequest request = new GDXFacebookGraphRequest().setNode("me/invitable_friends").useCurrentAccessToken();
from class FriendList
I get an error. I've tried with and without installing facebook again. Do I need to pass gdxFacebook
from class Login
in order to use the access token? or is there a better way?
Error message:
E/AndroidRuntime: FATAL EXCEPTION: GLThread 69865
Process: com.scene2d.tut.android, PID: 16786
java.lang.NullPointerException: Attempt to invoke virtual method 'void de.tomgrill.gdxfacebook.core.GDXFacebook.newGraphRequest(de.tomgrill.gdxfacebook.core.GDXFacebookGraphRequest, de.tomgrill.gdxfacebook.core.GDXFacebookCallback)' on a null object reference