Skip to content

Instantly share code, notes, and snippets.

@moltak
Last active August 29, 2015 14:04
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save moltak/510c6ee75f9d097e312d to your computer and use it in GitHub Desktop.
Save moltak/510c6ee75f9d097e312d to your computer and use it in GitHub Desktop.
polling code
new Thread(new Runnable() {
@Override
public void run() {
while(true) {
if(toShow != null && toShow.size() > 0) {
// 잠옹코드
break;
}
// toShow사이즈가 0보다 크지 않으면 0.5초간 슬립
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
}
}
}).start();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment