Back to project page twawm2.
The source code is released under:
Copyright (c) 2014, afnf All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistr...
If you think the Android project twawm2 listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.appspot.afnf4199ga.wmgraph.app; //from w w w . java2s .c o m import com.appspot.afnf4199ga.twawm.router.RouterControl; import com.appspot.afnf4199ga.twawm.router.RouterInfo; import com.appspot.afnf4199ga.utils.Logger; public class FetchThread extends Thread { private long lastUpdate = -1; boolean working = true; @Override public void run() { Logger.i("FetchThread started"); try { while (working) { // ??????? boolean success = false; if (working) { // execFetchInfo?? RouterInfo routerInfo = RouterControl.execFetchInfo(); if (routerInfo != null) { success = true; } // ???????repaint if (working) { UIAct.postRepaint(routerInfo); } lastUpdate = System.currentTimeMillis(); } // ???? long tmp = MainActivity.interval; if (success == false) { tmp = 5000; } else if (System.currentTimeMillis() - lastUpdate <= 500) { tmp = 500; } Thread.sleep(tmp); } } catch (Throwable e) { } Logger.i("FetchThread finished"); } }