ScheduledExecutorService exec = Executors.newSingleThreadScheduledExecutor(); exec.scheduleAtFixedRate(new Runnable() { @Override public void run() { Shout.loadUrl("http://www.bengaard.com/OB/shoutstart.php?konto="+konto); } }, 10, 20, TimeUnit.SECONDS);
So this piece of code simply reloads the page every 20 seconds with a 20 second initial delay which is very ideal for updating my shoutbox. Of course, you can change the WebView with whatever code you need to execute between fixed intervals.
This is awesome, if you just could do this to an iPhone.. :D
ReplyDeleteI envy your awesomeness sir
ReplyDelete