AlertDialog Timeout

by Shekhar » Fri, 23 Apr 2010 01:26:32 GMT


Sponsored Links
 Hi,

I have to create an alert dialog which will timeout after 3
seconds.How can I use timer for it? In AlertDialog class i am not
seeing any member function to set it.

Thanks,
Shekhar

--



AlertDialog Timeout

by krox » Fri, 23 Apr 2010 01:31:17 GMT


 Hi!

Maybe not the optimal solution (quite new to Android development) but
spawn a new thread when you show() the AlertDialog, let the Thread
sleep 3000 ms and then call myDialog.dismiss(). You might have to use
RunOnUIThread() as well since it is messing with the UI. Someone out
here might have a more elegant solution but this should
(probably ;-) ) work.

Cheers,
Erik



>


Sponsored Links


AlertDialog Timeout

by Liviu Ungureanu » Fri, 23 Apr 2010 01:35:43 GMT


 Hi!

 You have to create a thread which count until 3 and when counter is 3 you
have to call - via an handler -  yourDialogObject.cancel().

Hope this help.

--



AlertDialog Timeout

by faizan khan » Fri, 23 Apr 2010 03:22:31 GMT


 use java.util.timer to invoke timertask which will trigger
dialog.dismiss().do not forget to call dialog.dismiss from UI thread





> >



Other Threads

1. How do I set the focus to a widget?

I am trying to set the focus to a EditText widget, but I don't see any
way to do it.  What am I missing?

Thanks.
--~--~---------~--~----~------------~-------~--~----~

2. Capture / Trap for ActivityNotFoundException

I am playing with "android.speech.action.RECOGNIZE_SPEECH" and in the
source it says to trap for ActivityNotFoundException.  However, I am
not sure how I can do this, the activity class doesn't support this
event.

I found it as part of android.content, but am not sure how to
implement it.  Multiple inheritance?

--~--~---------~--~----~------------~-------~--~----~

3. how to change system wallpaper

4. Threading priority in Open MAX components.

5. Using Binder

6. Out of memory exception on setting wallpaper

7. class com.android.camera.UploadService does not exist?