I have an activity which extends GLActivity class.
I need to use FaceBook sdk to do some facebook interactions. So i create a new activity every time i need something from facebook. When it’s done i call finish() to get back into main activity.
How to call it once and then just use its functions? There is some tasks which do not need a dialog screen (like check if session is active) but still i need to call intent to create new one(because in the FacebookActivity.OnCreate functions are some initializations and i have to finish() it every time) and it looks stubborn. Every time activity pups out for a second.
Or how can i call some Facebook stuff without creating an activity? (I dont have any button, everything is called from native code.)
Upd: I know there is AsyncFacebookRunner but his methods are deprecated and it uses deprecated facebook functionality.
Upd2: I’ve made this activity invisible, but still i don’t think this is
the best solution.
Normally you’d just let your Activity extend the FacebookActivity. As this doesn’t work out for you as you extend GLActivity, you should look at the code of the FacebookActivity and simply copy the relevant parts into your Activity. So you can achieve the same as inheriting from GLActivity and FacebookActivity.
The code is in the facebook library project in the com.facebook package.