Skip to content

Commit

Permalink
add check if fragment is added
Browse files Browse the repository at this point in the history
Vérification avant de procéder à la mise en place de la barre de
progression
  • Loading branch information
Sonphil committed May 24, 2017
1 parent ad024eb commit 883123e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,8 @@ public void onRequestSuccess(Object o) {
for (int i = listeDeSessions.liste.size() - 1; i > 0; i-- ) {
dateStart = Utility.getDateFromString(listeDeSessions.liste.get(i).dateDebut);
dateEnd = Utility.getDateFromString(listeDeSessions.liste.get(i).dateFin);
setSemesterProgressBarText(dateStart, dateEnd);
if (isAdded())
setSemesterProgressBarText(dateStart, dateEnd);
if (currentDate.getTime() >= dateStart.getTime() && currentDate.getTime() <= dateEnd.getTime()) {
String dateStartString = Utility.getStringForApplETSApiFromDate(dateStart);
String dateEndString = Utility.getStringForApplETSApiFromDate(dateEnd);
Expand Down

1 comment on commit 883123e

@ttauveron
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Le code source de ÉTSMobile est pas parfait mais il existe la méthode overriden OnAttach() qui permet d'être sûr que le fragment est bien attaché à l'activité

Please sign in to comment.