I show a Dialog box to the user while loading a page.Would there be any problem if i show another Dialog box before dismissing the previous one?
I have tested it and its working fine.Just wanted to make sure.
I need to do this because-- When the user clicks on a button i show loading dialog box and users identity is verified in the background.If i dismiss this dialog box there the lag of say 2 sec( specially when network is very slow),before the user moves to the next activity.
I am showing another dialog box so that the user stays in that activity before all background work is done.
There would be no problem, when you are displaying one or two dialog boxes, but If you increase the number of dialog boxes, then your application becomes complex for users and it don't meet the user-friendly principles. you can use more dialog boxes in different places in your app.If you try to show more than three or four dialog continously, then your application will not meet the quality.
Related
I know this should not be a big challenge but it really drives me insane.
I am developing a simple soft keyboard input method and basically I have added a button to my softkeyboard, by pressing which, a dialog should pop up to prompt user to do some choices.
By far everything is ok about creating and opening the dialog. Since normally a dialog is created and displayed from outside an activity, so a flick solution could be to create a transparent activity which embedded the dialog in it. By doing so, I could easily start a dialog when user click the button on my softkeyboard.
But one tricky problem is: every time user click the button and the dialog (actually a dialog in a transparent activity) displays, it will always make my softkeyboard hide. I just need to start the dialog without any changes to the status of my softkeyboard -- I want my softkeyboard keeps showing when the dialog starts.
Here is a snapshot of Google Keyboard, it has the similar button which display a dialog and the dialog did not hide the keyboard, this is exactly what I want. So please anyone suggest me how to achieve this. Thanks so much.
THey aren't launching an Activity. They're launching a dialog. Which is tricky from an input method because its a service (you have to specify the dialog's window token to make it show) but doable.
I have two alert dialogs. Whenever app opens, the first dialog is shown. After some time, the second dialog is shown. But here problem is recently created dialog(second one) is in front. But I want the fist created dialog is in front and second one is behind the first one.
The problem with the dialog box is that you can not display two dialog box at a same time. You must hide first dialog box in order to display second one.
You can only display one dialog at the time, but you can "work around" this. When you are about to display your second dialog, you hide your first dialog, but your application remembers that the first dialog was open, so when you hide your second dialog you displays the first dialog again. In reality this will go so fast so the user is fooled that the dialog is layered over eachother(if they have the same dimensions).
But you cannot display a dialog on top of another dialog.
You can display first dialog in front :
When you are calling to display second one at that time call first dialog again so, that is in from view of your screen.
Let me know you understand this or not.. otherwise i will provide code for it..
You cant make two dialog active at same time either one should active and the other should inactive.In your case if you want the second should come background of fist then you have to call first dialog from the second.
I want to show a dialog (kind of splash screen) when my application is opened. Therefore I put a create and show dialog into onCreate(). The dialog opens indeed but first, the empty activity (white background) is shown.
There must be a possibility to prevent that empty screen to be shown? A lot of apps have a behaviour like that. I would like to have the dialog as the actual first screen to be shown to the user.
it would be better if we have code to see tasks taking time as per general solution
Android SplashScreen
Show spinning wheel dialog while loading data on Android
http://blog.iangclifton.com/2011/01/01/android-splash-screens-done-right/
When my app is first run, I would like to have a welcome message displayed in a dialog box. Then the user can click next at the bottom, and the box stays but a new layout is displayed where the user can input information.
How would I go about this? It would also be great if I was able to add an animation between the two layouts, the second one sliding in from the right for example. Is this possible?
I was thinking I may be able to use
builder.setView(secondlayout);
My application displays alert dialogs in some cases. Also, it is possible for a user to launch my application using the VIEW/SEND intent. The scenario I am considering is, the dialog is visible, the user presses 'Home' & selects my application to View/Share a file.
I would want to dismiss the dialog before beginning with the view/share operation. Although I can maintain which dialog is visible and hide it before the operation begins, I was wondering if there is a conventional/recommended way or API, something like activity.dismissAnyVisibleDialog() that can come in handy.
Thanks a lot,
Akshay
I finally myself maintained which dialog is visible & dismissed it before displaying the next one.
-Akshay
Just close the dialog in the onPause() method (override in your activity).
This way it will be dismissed when the activity is no longer visible i.e if you switch to the home screen.