use of ca.etsmtl.applets.etsmobile.http.MoodleWebService in project ETSMobile-Android2 by ApplETS.
the class MoodleCourseDetailsFragment method queryMoodleCoreCourses.
/**
* Query all resources for a Moodle course
*
* @param idCourse
*/
private void queryMoodleCoreCourses(final String idCourse) {
MoodleWebService service = dataManager.getMoodleService();
Call<List<MoodleCoreCourse>> courseCall = service.getCoreCourses(ApplicationManager.userCredentials.getMoodleToken(), Integer.parseInt(idCourse));
courseCall.enqueue(new Callback<List<MoodleCoreCourse>>() {
@Override
public void onResponse(Call<List<MoodleCoreCourse>> call, Response<List<MoodleCoreCourse>> response) {
if (response.isSuccessful() && response.body() != null) {
displayMoodleCourses(response.body());
}
}
@Override
public void onFailure(Call<List<MoodleCoreCourse>> call, Throwable t) {
Snackbar.make(getView(), R.string.moodle_error_cant_get_courses, Snackbar.LENGTH_SHORT).show();
}
});
}
Aggregations