TimerTask.java 543 B

123456789101112131415161718192021222324
  1. package de.tudarmstadt.informatik.hostage.sync.wifi_direct;
  2. /**
  3. * Created by Julien on 18.02.2015.
  4. */
  5. public class TimerTask extends BackgroundTask {
  6. private int seconds;
  7. public TimerTask(int seconds, BackgroundTaskCompletionListener l){
  8. super(l);
  9. this.seconds = seconds;
  10. }
  11. public boolean performInBackground(){
  12. try {
  13. Thread.sleep(this.seconds * 1000);
  14. } catch (InterruptedException e){
  15. // what ever
  16. return false;
  17. }
  18. return true;
  19. }
  20. }