Note that there are some explanatory texts on larger screens.

plurals
  1. POHandling a facebook-object through multiple activities
    text
    copied!<p>Currently I'm writing an adapter class to provide a convenient way for communication with the facebook API.<br> The way I thought about using it is to run the authentication when the app is starting up, <s>downloading user's private picture</s>, and later in the app publishing updates on users facebook wall using an <code>AsyncFacebookRunner</code>.</p> <p>However flipping through the <a href="https://developers.facebook.com/docs/reference/androidsdk/authentication/" rel="nofollow">documentation</a> it seems for every <code>authorize()</code> implementation the first parameter have to be an activity.</p> <blockquote> <p>void authorize(Activity activity, final DialogListener listener):</p> </blockquote> <p>And here I begin to wonder.</p> <p>Thinking about activities and life cycles what will happen when the activity I threw in will be destroyed? Wouldn't the reference for this object <code>Facebook.mAuthActivity</code> become invalid as well.<br> I see the <code>logout()</code> method "only" asks for a context.</p> <blockquote> <p>String logout(Context context) throws ...:<br> context - The Android context in which the logout should be called: it should be the same context in which the login occurred in order to clear any stored cookies</p> </blockquote> <p>From what I see I can not guarantee the "login-activity" will still be present as app's uptime increases - actually the opposite is more likely.</p> <p>Are there any special situations I should consider to prevent the app form total crashing in a later state?</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload