Skip to content

Instantly share code, notes, and snippets.

@sax1johno
Created August 12, 2015 16:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sax1johno/a7319b2b672248427438 to your computer and use it in GitHub Desktop.
Save sax1johno/a7319b2b672248427438 to your computer and use it in GitHub Desktop.
public class MyActivity extends Activity {
Handler mHandler; // These are used to manage multiple threads in Android.
.....
@Override
protected void onCreate(Bundle savedInstanceState) {
mHandler = new Handler();
mHandler.post(new Runnable() {
@Override
public void run() {
// Do all of your network / facebook stuff in here
// but make sure that the facebook stuff has finished executing before
// trying to use it.
}
}
}
.....
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment