Skip to content

Instantly share code, notes, and snippets.

@shelajev
Created January 15, 2016 16:21
Show Gist options
  • Select an option

  • Save shelajev/4f53ea53313b4aa09a4c to your computer and use it in GitHub Desktop.

Select an option

Save shelajev/4f53ea53313b4aa09a4c to your computer and use it in GitHub Desktop.
retrofit2-EventListener.java
Button button = (Button) findViewById(R.id.button);
button.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
GitHubService gitHubService = GitHubService.retrofit.create(GitHubService.class);
final Call<List<Contributor>> call = gitHubService.repoContributors("square", "retrofit");
new NetworkCall().execute(call);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment