Hold on a second.

Calling start() on a thread surely keeps a reference somewhere that would
prevent the thread from being GC'd while it's still running.

As for the breakpoint, quoting Bob's original message:

>>
Now put a breakpoint on this line in the thread:

BluetoothAdapter bluetoothAdapter = BluetoothAdapter
.getDefaultAdapter();
<<

Is not a very specific description, because there are two lines here
forming a single statement, if the original formatting is preserved.

Single-stepping and breakpoints sometimes act a little weird with
multi-line statements.

And -- at least in my environment, Eclipse 3.7.2, latest Android stuff -- a
breakpoint set on the second of those two lines triggers, but a breakpoint
set on the first of the two does not.

To make the line-to-code matching more visual, one can add a statement
above the two lines in question, set a breakpoint there, then single-step.

The "currently executing line" highlight will never hit the first of those
two lines, but will hit the second one.

-- K

2012/11/2 Latimerius <l4t1m3r...@gmail.com>

> On Fri, Nov 2, 2012 at 4:25 PM, bob <b...@coolfone.comze.com> wrote:
> > I changed it to this:
> >
> > Listener_Thread listener_Thread = new Listener_Thread(this);
> > listener_Thread.start();
>
> Well what is the lifespan of listener_Thread?  If it's local in
> onCreate() as seems to be implied then you haven't changed much as
> listener_Thread will go out of scope just moments later, leaving your
> Listener_Thread instance with no references again.  Try making
> listener_Thread a member variable of your Activity to make it longer
> lived (if just for the sake of test).
>
> If your problem is 100% reliably reproducible then this might not be
> the root cause.  However, it could be one of the causes.
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to android-developers@googlegroups.com
> To unsubscribe from this group, send email to
> android-developers+unsubscr...@googlegroups.com
> For more options, visit this group at
> http://groups.google.com/group/android-developers?hl=en
>

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to