Example #1
0
 /** Stop the polling for the market info, if it is already stop this call does nothing */
 private void stopPolling() {
   if (timer != null) {
     timer.cancel();
     timer.purge();
     timer = null;
     pollTask.cancel();
     pollTask = null;
   }
 }
Example #2
0
 private void startOrStopMarketRatePolling() {
   if (address != null && !pocket.isType(address)) {
     String pair = ShapeShift.getPair(pocket.getCoinType(), (CoinType) address.getParameters());
     if (timer == null) {
       startPolling(pair);
     } else {
       pollTask.updatePair(pair);
     }
   } else if (timer != null) {
     stopPolling();
   }
 }