AlertDialog Timeout

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

Sponsored Links

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.



AlertDialog Timeout

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


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.



Sponsored Links

AlertDialog Timeout

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


 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. forde to open the Launcher, not the last Activity

I would like to force my app to go to the launcher when i clik on it
in the Home Screen

I am in any activity of my app and i click HOME button and go to the
Home Screen, If i click on my launcher then i always go to the last
activity where i clicked HOME button, instead of my launcher activity

I have tried with launch modes, with android:clearTaskOnLaunch, with
android:finishOnTaskLaunch and they never work!!!

Android always starts with the lastActivity onRestart() method instead
of my launcher activity.

How can i do that please? I need your help:

this is my code in the manifest:

<activity android:name=".cem.activity.LanzadorCeM"
                        <intent-filter android:label="@string/textLanzadorCeM">
android:name="android.intent.action.MAIN" />
android:name="android.intent.category.LAUNCHER" />


2. totally 2d

Let's say you are making a totally 2d game for Android.  Does it make
sense to use OpenGL?  Will you get a better framerate or anything




3. Secure SDCard (MicroSD)

4. Well displayed in portrait but not in landscape

5. Amazon Market Reporting

6. Changing ImageView's image

7. CTS and frameword modifications