Alexandre Lision | 064e1e0 | 2013-10-01 16:18:42 -0400 | [diff] [blame] | 1 | package org.sflphone.model; |
Alexandre Lision | 5249256 | 2013-09-16 16:56:09 -0400 | [diff] [blame] | 2 | |
| 3 | import java.util.Observable; |
| 4 | |
| 5 | import android.util.Log; |
| 6 | |
| 7 | public class CallTimer extends Observable implements Runnable { |
| 8 | |
| 9 | boolean stop = false; |
| 10 | private static final String TAG = CallTimer.class.getSimpleName(); |
| 11 | |
| 12 | @Override |
| 13 | public void run() { |
| 14 | |
| 15 | while (!stop) { |
| 16 | try { |
| 17 | synchronized (this) { |
| 18 | this.wait(1000); |
| 19 | } |
| 20 | } catch (InterruptedException e) { |
| 21 | e.printStackTrace(); |
| 22 | } |
| 23 | Log.i(TAG, "update!"); |
| 24 | notifyObservers(); |
| 25 | } |
| 26 | |
| 27 | } |
| 28 | |
| 29 | @Override |
| 30 | public boolean hasChanged() { |
| 31 | return true; |
| 32 | } |
| 33 | |
| 34 | } |