Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public Runnable mUpdate = new Runnable() {
- public void run() {
- while (nowRunning) {
- synchronized (this) {
- try {
- wait();
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
- }
- runOnUiThread(new Runnable() {
- @Override
- public void run() {
- drawPlaces();
- }
- });
- }
- }
- };
- //Tell runnable to stop waiting
- @Override
- protected void onPause() {
- super.onPause();
- nowRunning = false;
- synchronized (mUpdate) {
- mUpdate.notify();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement