57 |
|
|
58 |
long imei; |
long imei; |
59 |
|
|
60 |
Thread t; |
//Thread t; |
61 |
|
|
62 |
public RadarView(Context context) { |
public RadarView(Context context) { |
63 |
super(context); |
super(context); |
96 |
surfaceHolder = this.getHolder(); |
surfaceHolder = this.getHolder(); |
97 |
surfaceHolder.addCallback(this); |
surfaceHolder.addCallback(this); |
98 |
|
|
|
t = new Thread(this); |
|
99 |
|
|
100 |
updateDistanceTexts(); |
updateDistanceTexts(); |
101 |
} |
} |
164 |
hcenter = width / 2; |
hcenter = width / 2; |
165 |
vcenter = hcenter + 20; |
vcenter = hcenter + 20; |
166 |
|
|
167 |
t.start(); |
mRun = true; |
168 |
|
Thread drawThread = new Thread(this); |
169 |
|
|
170 |
|
drawThread.start(); |
171 |
locator.setDroidsLocatedListener(this); |
locator.setDroidsLocatedListener(this); |
172 |
|
locator.setContinue(true); |
173 |
Thread locatorThread = new Thread(locator); |
Thread locatorThread = new Thread(locator); |
174 |
locatorThread.start(); |
locatorThread.start(); |
175 |
} |
} |
179 |
public void surfaceDestroyed(SurfaceHolder holder) { //surfaceholder.CallBack |
public void surfaceDestroyed(SurfaceHolder holder) { //surfaceholder.CallBack |
180 |
Log.i("surfacDestroyed()","-"); |
Log.i("surfacDestroyed()","-"); |
181 |
mRun = false; |
mRun = false; |
182 |
locator.stop(); |
locator.setContinue(false); |
183 |
} |
} |
184 |
|
|
185 |
public void run() { |
public void run() { |
204 |
Thread.sleep(20); |
Thread.sleep(20); |
205 |
} catch (InterruptedException e) {} |
} catch (InterruptedException e) {} |
206 |
} |
} |
207 |
|
Log.i("RadarView", "Draw thread exiting"); |
208 |
} |
} |
209 |
|
|
210 |
|
|