I am showing notifications and on click of it i will show item details but before showing details i am showing password input alert then i have to show the details,i need to clear the background activity screen when alert appears,i have attached the image below,how to clear the background activity when alert appears ,i just need to show the data when password entered is valid else not or is there any other way to show alert on click of notification before showing item data ???
1) On the popup, you could set all the items in the xml to hidden
2) If the background is a website (genuinely cant tell), you could just hide that layout in the xml again
3) You could start a new activity on notification press with just the login screen on, then use the startActivityForResult to get the values
4) Create a frame layout above your xml, then hide/show that
Related
The normal way to create an alert dialog is to attach it to the current activity, like in How do I display an alert dialog on Android?
However, what I want to achieve is to create an alert dialog that is not attached to a particular activity. So that when the activity is destroyed (e.g. using finishAndRemoveTask), my dialog is still here.
Is there a way to achieve that? Also, I would like the area outside of the alert dialog to be unclickable, i.e. the user must click on the ok button of the dialog in order to navigate to other activities.
I am opening a dialog fragment on Button click in a activity. Now I don't want loose focus on my background activity after opening the dialog fragment. The background activity has a chat window so the edit text in that chat window should not loose focus, to be more precise one should be able to chat even when the dialog fragment is open. Is there any way to make this happen?
One can place an individual layout( which is your dialog layout ) onto the center of the screen
(gravity="center" or centerinParent="true")
and set its visibility to invisible or gone.Then when you make the dialog layout appear, the edittext will be focusable as well.
I would encourage other answers which may be an alternative to this behavior which the OP wants.
In my android app, I want to show a spinner in my activity when a user clicks login button after entering the details.The spinner should appear only till the login process is validated in the background. After it is done, then the spinner should disappear and the user should be taken to the desired activity.
I think you might have trouble finding this because in Android the 'Spinner' name is already taken for another control. What you are looking for is an Activity Circle in the form of a ProgressBar. Maybe these SO questions will be of help to you:
Show activity circle before loading webview - Android
how to show progress bar(circle) in an activity having a listview before loading the listview with data
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.
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);