Last active
January 4, 2020 21:58
-
-
Save magdamiu/74b216bbafa7dd9814bd13333f1dc5ff to your computer and use it in GitHub Desktop.
Combine the code and get the list of the users
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class GithubActivity extends AppCompatActivity { | |
private UsersRepository usersRepository; | |
@Override | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
setContentView(R.layout.activity_github); | |
usersRepository = UsersRepository.getInstance(); | |
usersRepository.getUsers(new OnGetUsersCallback() { | |
@Override | |
public void onSuccess(List<User> users) { | |
StringBuilder stringBuilder = new StringBuilder(); | |
for (User user : users) { | |
stringBuilder.append(user.toString() + " /// "); | |
} | |
Logging.show("Github users = ", users.toString()); | |
Toast.makeText(GithubActivity.this, stringBuilder.toString(), Toast.LENGTH_LONG).show(); | |
} | |
@Override | |
public void onError() { | |
Logging.show("error Github users = ", "check the code :D "); | |
Toast.makeText(GithubActivity.this, "error getting the Github users", | |
Toast.LENGTH_LONG).show(); | |
} | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment