just trying to allow my application to access basic information from an authenticated Facebook user, but my logcat tells me
06-30 16: 37: 27.969: WARN / System.err (1559): com.facebook.android.FacebookError: the active access token should be used to request information about the current user.
immediately after authentication, where the code is executed. Can someone point me in the right direction? I saw a very similar post where someone used almost identical code and it worked.
thanks
Facebook facebook = new Facebook("187212574660004"); TextView nText; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); nText = (TextView) this.findViewById(R.id.nameText); facebook.authorize(this, new String[] {"offline_access", "user_interests", "friends_interests"}, new DialogListener() { public void onComplete(Bundle values) { setContentView(R.layout.homepage); } public void onFacebookError(FacebookError error) {} public void onError(DialogError e) {} public void onCancel() {} }); JSONObject json_data = null; try { JSONObject response = Util.parseJson(facebook.request("me/friends"));
Tried the method described earlier by Manno23 and got
06-30 19:27:04.338: ERROR/AndroidRuntime(349): Caused by: java.lang.NullPointerException 06-30 19:27:04.338: ERROR/AndroidRuntime(349): at com.staffit.FacebookPage.getFriends(FacebookPage.java:67) 06-30 19:27:04.338: ERROR/AndroidRuntime(349): at com.staffit.FacebookPage.access$0(FacebookPage.java:55) 06-30 19:27:04.338: ERROR/AndroidRuntime(349): at com.staffit.FacebookPage$1.onComplete(FacebookPage.java:41) 06-30 19:27:04.338: ERROR/AndroidRuntime(349): at com.facebook.android.Facebook.authorizeCallback(Facebook.java:383) 06-30 19:27:04.338: ERROR/AndroidRuntime(349): at com.staffit.FacebookPage.onActivityResult(FacebookPage.java:93) 06-30 19:27:04.338: ERROR/AndroidRuntime(349): at android.app.Activity.dispatchActivityResult(Activity.java:3907) 06-30 19:27:04.338: ERROR/AndroidRuntime(349): at android.app.ActivityThread.deliverResults(ActivityThread.java:2492) 06-30 19:27:04.338: ERROR/AndroidRuntime(349): ... 11 more
source share