--- android/DroidRadar/src/dk/thoerup/droidradar/RadarView.java 2009/08/25 05:59:52 280 +++ android/DroidRadar/src/dk/thoerup/droidradar/RadarView.java 2009/08/25 19:00:58 281 @@ -57,7 +57,7 @@ long imei; - Thread t; + //Thread t; public RadarView(Context context) { super(context); @@ -96,7 +96,6 @@ surfaceHolder = this.getHolder(); surfaceHolder.addCallback(this); - t = new Thread(this); updateDistanceTexts(); } @@ -165,8 +164,12 @@ hcenter = width / 2; vcenter = hcenter + 20; - t.start(); + mRun = true; + Thread drawThread = new Thread(this); + + drawThread.start(); locator.setDroidsLocatedListener(this); + locator.setContinue(true); Thread locatorThread = new Thread(locator); locatorThread.start(); } @@ -176,7 +179,7 @@ public void surfaceDestroyed(SurfaceHolder holder) { //surfaceholder.CallBack Log.i("surfacDestroyed()","-"); mRun = false; - locator.stop(); + locator.setContinue(false); } public void run() { @@ -201,6 +204,7 @@ Thread.sleep(20); } catch (InterruptedException e) {} } + Log.i("RadarView", "Draw thread exiting"); }