Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int delay = 1800000; // delay de 30 min.
- int interval = 600000; // intervalo de 10 min.
- Timer timer = new Timer();
- timer.scheduleAtFixedRate(new TimerTask() {
- public void run() {
- try {
- if (Util.verificaConexaoWIFI(EntradaActivity.this) == true || Util.verificaConexaoGPRS3G(EntradaActivity.this) == true) {
- PalmPedidoVendaDAO pedido = new PalmPedidoVendaDAO(EntradaActivity.this);
- if (pedido.getListaPedido() != null) {
- if (statusSincronizacao == 1) { // Verifica se a sincronização está liberada
- // Envia os dados para o webservice
- }
- }
- }
- }catch (Exception e){
- throw new RuntimeException("SEM CONEXÃO COM A INTERNET ! " + e.getMessage());
- }
- }
- }, delay, interval);
Add Comment
Please, Sign In to add comment