Questions tagged [android-alertdialog]

A subclass of Dialog that can display one, two or three buttons. If you only want to display a String in this dialog box, use the setMessage() method.

A subclass of Dialog that can display one, two or three buttons. If you only want to display a String in this dialog box, use the setMessage() method. If you want to display a more complex view, look up the FrameLayout called "custom" and add your view to it:

FrameLayout fl = (FrameLayout) findViewById(android.R.id.custom);
fl.addView(myView, new LayoutParams(MATCH_PARENT, WRAP_CONTENT));

The AlertDialog class takes care of automatically setting WindowManager.LayoutParams.FLAG_ALT_FOCUSABLE_IM for you based on whether any views in the dialog return true from View.onCheckIsTextEditor(). Generally you want this set for a Dialog without text editors, so that it will be placed on top of the current input method UI. You can modify this behavior by forcing the flag to your desired mode after calling onCreate(Bundle)

Reference

5697 questions
1
vote
1 answer

Android - Make the background part of the Dialog available

I am creating an AlertDialog as follows. I fix the dialog view to the bottom of the screen. Average width: 400, height: 200 dimensions. (Actually I want it to be something like Admob-banner) I always want the screen I started with show () to remain…
enjektor0
  • 483
  • 2
  • 8
1
vote
0 answers

Getting user input on AlertDialog from fragment in Kotlin

I am trying to get the user input from an AlertDialog within a Fragment. The layout worked all right but when I try input a value and retrieve it on a Toast, the app crashes. Below is my last try to build the AlertDialog. val editText :…
1
vote
1 answer

The AlertDialog dosen't show when activity start

This is my first time asking for help here. Basically the problem is that I want to show an AlertDialog and then start an activity with an intent. The problem is that the intent starts without showing the AlertDialog and I don't get why. But if I…
Leo_Miche
  • 13
  • 5
1
vote
1 answer

How can I make an AlertDialog with multiple items whose names are defined at runtime?

This explains how to do it when you know the names for the items at compile time, but what if I want them defined at runtime... i.e. Today, Tomorrow, (Day and Date after Tomorrow), etc...
finiteloop
  • 4,444
  • 8
  • 41
  • 64
1
vote
4 answers

alert dialog not showing

I am showing my alert dialog in a separate thread and its not working for me. initially when I click register button for 3000ms I am showing a progress dialogue. and after that I want to show a alert box but its not working. How to solve this? …
Randroid
  • 3,688
  • 5
  • 30
  • 55
1
vote
0 answers

Displaying terms and conditions in an alert dialog - android

I'm writing my own forum app. I've a MaterialTextView, I want to display an Alert showing terms and conditions with OK button. Here is the code:
Ajay Kulkarni
  • 2,900
  • 13
  • 48
  • 97
1
vote
3 answers

How to control AlertDialog

I have created an app which includes popups of different dialogs. Here is my code: if (lDiffFromToday >= 0 && lDiffFromToday <= DeclareVariable.CYCLE_MAX_LENGTH) { AlertDialog.Builder alrtStartMonitoring = new AlertDialog.Builder(this); …
AndroidDev
  • 4,521
  • 24
  • 78
  • 126
1
vote
4 answers

Custom Alert Dialog does not dismiss

I am creating a custom AlertDialog to show loading on button click event listener. The Alert dialog show() function works fine but the dismiss() function is not working public AlertDialog LoadDialog() { AlertDialog.Builder builder = new…
Daniel Nyamasyo
  • 2,152
  • 1
  • 24
  • 23
1
vote
0 answers

AlertDialog Hides AutoCompleteTextView DropDown

In my form, there are two AutoCompleteTextViews which are populated by custom adapter. But searching takes one or two seconds so I want to show users a Loading animation in an AlertDialog. To achieve this I declared a boolean LiveData variable in…
bahadir arslan
  • 4,535
  • 7
  • 44
  • 82
1
vote
1 answer

AlertDialog Listener not attached

MyAlertDialog throws ClassCastException when trying to set the context to the listener. I'm calling the MyAlertDailog from a fragment. I'm using the guide found in the android dev…
Shawn
  • 1,222
  • 1
  • 18
  • 41
1
vote
3 answers

Deactivate AlertDialog "OK" button till a text is typed on the EditText of the AlertDialog view

In android studio I need to deactivate the positive(OK) button of an AlertDialog until the user types into the EditText.
Kenart
  • 285
  • 3
  • 14
1
vote
1 answer

How to show an Alert PopUp from an Alert PopUp in Xamarin android

I have created an Alert Popup that asks the user whether they want to edit or delete a reminder. If the user clicks on the delete reminder button I want to show another Alert Popup that asks whether the user is sure or not. Something like…
d51
  • 316
  • 1
  • 6
  • 23
1
vote
2 answers

android.view.WindowLeaked / Android Intent

When I run below codes I get this error message : "020-11-07 18:45:26.737 20684-20684/com.user.example E/WindowManager: android.view.WindowLeaked: Activity com.user.example.Pages.Dashboard.Home has leaked window DecorView@14fe64f[Home] that was…
user14406526
1
vote
2 answers

How to prevent AlertDialog box getting dismissed when clicked outside the dialog box?

I have an AlertDialog box that I am using to get input from the user. But when the user clicks outside the dialog, it is getting dismissed irrespective of whether the user has entered the input or not. That input is very crucial for further…
Levi
  • 187
  • 2
  • 17
1
vote
2 answers

How to update the content of an AlertDialog with setState?

I need to know if there is a way to update its content like a value of a linear progress indicator, is that possible, I searched for this problem but didn't find a satisfying answer. code else { setState(() { percentage…
1 2 3
99
100