It's pretty much what it said in your original logcat:
06-15 15:49:11.467: ERROR/AndroidRuntime(271):
android.util.AndroidRuntimeException: { what=6 when=56421 } *This message is
already in use.*
A message posted to a Handler is "in use" until it's delivered to the other
side, at which point it becomes "free" again.
-- Kostya
2011/6/17 andorid.italia <[email protected]>
> I need to use Thread / Runnable / sleep() because in future I have to
> use a Controller that manages many widgets.
> I've tried with your suggestion, and it works very nice.
>
> Now it works with the following code :
>
> do{
> message1 = Message.obtain();
> SystemClock.sleep(sleep_time);
> message1.what=x + 10;
> x=message1.what;
> handler1.sendMessage(message1);
> } while (!Thread.currentThread().isInterrupted());
>
> Can you explain me why it didn't work without Message.obtain() at each
> sendMessage() ????
>
> Thank you very much !!!
>
> --
> You received this message because you are subscribed to the Google
> Groups "Android Developers" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> 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 [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en