I have two activities that need to use my Facebook object. The first activity does the logging in process the second needs the Facebook object to get a list of friends. I am using a class that extends Application to transport the Facebook object from the first activity to the second.
This works fine, but when I logout and login on the first activity I get this error when trying to use the Facebook object on the second activity
{"error_code":104,"error_msg":"Requires valid signature","request_args"
I am updating the Facebook object when I log back in and I am updating the Facebook object in my Application class. Any idea why I might be getting this error?
You don’t need to pass the Facebook object from one activity to another, instead save the access token and expiration time into the preferences and get them in the other activity.
This is also good if the user returns to the app later on.
You can use the SessionStore class from the official facebook examples, which will make it easier to save/get the auth info.
So in the first activity you can:
And in the second activity: