Pedro,
What are you trying to accomplish exactly here? If you are just trying
to show a message to the user for a certain period of time, all you
need is Toast.makeText().
If you are using a looper you need to create add a Handler member to
your class that will receive and process messages from the message
loop. Presumably the Handler then contains some logic to call
Looper.myLooper().quit(). When Looper.loop() is called your thread
will go into the message handling loop until some code that executes
in that loop (from your Handler) tells the loop to stop.
I've posted a sample of using the Looper class in a file called
dorothy.zip
Cheers,
Justin
On May 19, 3:42 am, Pedro Cristovão <[EMAIL PROTECTED]> wrote:
> hi all.
>
> my android application freezes when using the Looper.prepare() ->
> Looper.loop() -> Looper.myLooper().quit() sequence. here's the code
> where it blocks:
>
> public void endData() {
> String result = new String(baf.toByteArray());
>
> Looper.prepare();
> Toast.makeText(myActivity, result,
> Toast.LENGTH_SHORT).show();
> Looper.loop();
>
> Looper.myLooper().quit();
>
> }
>
> any sugestion of what the problem might be?
>
> thanks in advance,
>
> pedro cristovão.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---