From f57164fc5668f6ebf63fdca62461260979c521fa Mon Sep 17 00:00:00 2001 From: JLo'w Date: Sat, 7 May 2016 16:15:08 +0200 Subject: [PATCH] Alerte expiration ne pop plus quand on se déco --- PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java b/PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java index 21063d2..c269c80 100644 --- a/PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java +++ b/PremiereActivite/app/src/main/java/com/example/app_10p5/MainActivite.java @@ -41,7 +41,7 @@ public class MainActivite extends Activity implements ASyncResponse, main_tab_fr public static final int STATE_ANNULER= 6; public static final int STATE_REFAIRE = 7; - public static final long EXPIRATION = 1000*10*1; + public static final long EXPIRATION = 1000*60*10; private int mState; private String mToken; @@ -72,11 +72,13 @@ public class MainActivite extends Activity implements ASyncResponse, main_tab_fr mTimerRunnable = new Runnable() { @Override public void run() { - if(System.currentTimeMillis() - mTimeToken >= EXPIRATION){ - afficherPopup(); - } - else{ - mTimerHandler.postDelayed(this, 5000); + if(TextUtils.getTrimmedLength(mToken) == 30){ + if(System.currentTimeMillis() - mTimeToken >= EXPIRATION){ + afficherPopup(); + } + else{ + mTimerHandler.postDelayed(this, 5000); + } } } }; -- libgit2 0.21.2