Android Display spinners in Ok/Cancel popup dialog - android

I want to have a popup dialog with OK/Cancel and two spinners.
(1) Is this possible?
(2) Has this been done in any other apps?
Thanks

Yes that's possible take a look at how to implement custom dialogs:
http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog

Related

How to bypass android dialog outside click

What I want to do is to show the dialog message but make it still possible to click on the items behind. On any click, the dialog would dismiss
Right now I need to click once to dismiss the dialog and a second time to click on a field.
It is something possible ? Or is there an alternative to using Dialogs?
Edit: Solution found by adding Layout Flags to the window.
In kotlin:
dialog.window?.setLayout(ConstraintLayout.LayoutParams.FLAG_NOT_FOCUSABLE, ConstraintLayout.LayoutParams.FLAG_NOT_FOCUSABLE)
By using Dialog you cannot achieve what you are looking for. instead of using Dialog USE FRAGMENT.
The examples are given in official documentation here.
You Can define a full layout in the background of the dialog and set onClick listener to that layout

Alert dialog info button

I am a beginner in android programming and I have noticed, that my tablet Sony Xperia Z4 (Android 6.0) got an alert dialog with 3 buttons: positive, negative and the other one, see in the picture below. This is main menu, not my application.
Alert Dialog info button
My question: is this a custom dialog? I have never met with this type of button in alert dialog.
Thank you.
EDIT:
Duplicate? I don't think so...
AlertDialog.Builder with custom layout and EditText; cannot access view
Why?
User got a problem with accessing an edit text in his dialog.
My question is, if dialog in my tablet is CUSTOM. Nothing else :)
This is not an AlertDialog, instead is just a Dialog with a custom layout, you can do it, you can bind buttons and views to a Dialog and make a custom one like the image you posted. Here is a post that might help you out
How to create a Custom Dialog box in android?

How to create a custom PopUp Menu

I would like to create a custom PopUp menu in Android like the one in the attached screenshot. Any pointers would be appreciated.
On click of the button "Choose Name" , you see a PopUp menu just below the button.
Thaknks.
You should take a look at building custom dialogs. In Android, a Dialog is typically in the form of a popup window. You can also do this with an Activity and apply the Dialog theme to it (mentioned in this link).
Sana,
You will probably want to look into creating a custom Dialog for your application: http://developer.android.com/guide/topics/ui/dialogs.html#CustomDialog

AlertDialog buttons always close the dialog once clicked

I'm using an AlertDialog with 2 buttons (one positive, one negative).
I've set a handler for those buttons which doesn't mention dismiss. Indeed after clicking, I don't want the dialog to close. However, it seems that as soon as we click on a positive/negative button on an AlertDialog, it always get closed.
Is there a way to prevent the dialog from closing after clicking on any button ?
Thanks,
Vincent
Use custom layout for Dialog and you will be happy!
Use a custom dialog, not an AlertDialog.
You can also create a new Activity and assign it the theme dialog in your manifest with
<activity android:name="MyDialogActivity" android:theme="#android:style/Theme.Dialog" />

Opening a Modal Pop Up window

I want to show a modal pop up window with a TextView and two buttons when the user "clicks" on a ListView item.
How can I do that?
Take a look at the AlertDialog.Builder class.
http://developer.android.com/guide/topics/ui/dialogs.html#AlertDialog
The above link should provide you with all the necessary information.

Categories

Resources