Guest User

Untitled

a guest
Oct 16th, 2018
84
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. int delay = 1800000; // delay de 30 min.
  2. int interval = 600000; // intervalo de 10 min.
  3.  
  4. Timer timer = new Timer();
  5.  
  6. timer.scheduleAtFixedRate(new TimerTask() {
  7. public void run() {
  8. try {
  9. if (Util.verificaConexaoWIFI(EntradaActivity.this) == true || Util.verificaConexaoGPRS3G(EntradaActivity.this) == true) {
  10.  
  11. PalmPedidoVendaDAO pedido = new PalmPedidoVendaDAO(EntradaActivity.this);
  12.  
  13. if (pedido.getListaPedido() != null) {
  14. if (statusSincronizacao == 1) { // Verifica se a sincronização está liberada
  15. // Envia os dados para o webservice
  16. }
  17. }
  18. }
  19.  
  20. }catch (Exception e){
  21. throw new RuntimeException("SEM CONEXÃO COM A INTERNET ! " + e.getMessage());
  22. }
  23. }
  24. }, delay, interval);
Add Comment
Please, Sign In to add comment