Hi, You can dismiss the dialog shown by showalert() by clicking the back button on the emulator, if your dialog is cancelable. http://code.google.com/android/reference/android/content/Context.html#showAlert(java.lang.CharSequence,%20int,%20java.lang.CharSequence,%20java.lang.CharSequence,%20android.content.DialogInterface.OnClickListener,%20java.lang.CharSequence,%20android.content.DialogInterface.OnClickListener,%20boolean,%20android.content.DialogInterface.OnCancelListener)
If you want a show an alert which disappears automatically after a specified duration or disappears on calling cancel(), consider using the Toast class instead. Sample code for using Toast: The ApiDemos > apps> AlarmService.java,AlarmController.java Hope this helps! Thanks, Megha On Tue, Apr 1, 2008 at 6:37 AM, Raul Bocter <[EMAIL PROTECTED]> wrote: > never mind that one. it seems to work if I put loop() at the end of the > logic. > > I have another related problem now. I want to show two alerts, one after > the other, as the logic advances. But I can not get rid of the first alert. > Calling cancel() or dismiss() or both does not work. How can I loose an > alert programatically ? > > regards, > Raul > > > > > On Tue, Apr 1, 2008 at 4:07 PM, Raul Bocter <[EMAIL PROTECTED]> wrote: > > > Hello, > > > > > > I am trying to show alerts while doing some logic in the background. I > > want to do this in a new thread (not the UI thread). I don't understand how > > this should work. As I try to show the alert it throws an exception saying i > > have to call Looper.prepare() first. Ok, I call prepare(). The alert > > does not show until Looper.loop()gets called. But after loop(), the > > thread is stuck there. It will not go further. What would be a solution for > > this? > > > > regards, > > Raul > > > > > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Android Beginners" group. To post to this group, send email to android-beginners@googlegroups.com 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 -~----------~----~----~----~------~----~------~--~---