Skip to content

Instantly share code, notes, and snippets.

@patrykpoborca
Last active March 16, 2016 22:28
Show Gist options
  • Save patrykpoborca/70b81cede9c178f4fc79 to your computer and use it in GitHub Desktop.
Save patrykpoborca/70b81cede9c178f4fc79 to your computer and use it in GitHub Desktop.
RetrofitClient client = new Retrofit.Builder()
/*configure Retrofit */
.build().create(RetrofitClient.class);
private void retrieveSomeValue(String param) {
client.doRequest(param)
.subscribe(response ->{
getContext().getSharedPreferences("sharedpreferences", Context.MODE_PRIVATE)
.edit()
/*write response to disk */
.commit();
GlobalStateManager.getInstance(getContext(), response); // which then updates some global flags and
//uses context to launch an activity
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment