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.
5,705
questions
0
votes
0
answers
10
views
how to use AlertDialog in a normal Java class
I want to separate my business logic from the ui and I actually wanted to implement MVVM architecture for that. I have this class that I perform all my business logic but the issue is that the app ...
0
votes
1
answer
17
views
How do I create a dialog box after meeting a condition by checking firebase?
So I am currently writing an app which connects to a sensor module through Bluetooth and receives data in the form of a string. The data will contain a UID which will be compared to the key of ...
1
vote
0
answers
22
views
Override the Default Animation for AlertDialog Composable
How can I override the animation for the AlertDialog composable? The modifier doesn't have an animateEnterExit(). I want a pop enter and pop exit animation instead of the default fade in/out.
0
votes
0
answers
17
views
there is some bug in the androidbox firmwere,andbox rockchip rk3228a,in this bug there is a alert dialog box is open when we restart the android box?
I Have a android box in which I run my tv Appliction that are live running but there is some bug in the androidbox firmwere, model number of andbox is rockchip rk3228a,in this bug there is a alert ...
0
votes
0
answers
34
views
Update AlertDialog from within "for" loop
My app (Java 11, minSDK 29, targetSDK 30) uses an AlertDialog to inform the user of what step of the startup process it's currently on, which includes showing the name of the file that's currently ...
0
votes
3
answers
46
views
Change text color of dialog option items
I have this dialog in which the options appear with black text, and I would like to make it white
@SuppressLint("CutPasteId")
private fun showPageSelectionDialog() {
val options = ...
0
votes
0
answers
23
views
Darken the outer part of the dialogue
I have a dialog, but I want to darken its outer part.
Because I want it to stand out from the background a little.
private fun cancelOrder() {
val dialog = AlertDialog.Builder(requireContext())
...
0
votes
0
answers
116
views
Android Ime callback not found issue on AlertDialog dismiss
If we have a customized AlertDialog containing some input field, selection of that component would prompt the IME virtual keyboard of the device to pop up. Now, if we dismiss the entire AlertDialog by ...
0
votes
0
answers
61
views
Using WidgetsBinding.instance.addPostFrameCallback in my init state issue +flutter
I have a widget 'A' which is called as one of the tab in tab bar view. I am passing a valuenotifier closeDialog from the parent widget to the widget A like this :
ValueNotifier<bool> closeDialog ...
0
votes
0
answers
24
views
How to prevent a fragment (e.g. Alert Dialogfrom) from being destroyed in device languege change or in resume state?
My app crashed when I changed the device language with two parts error in logcat. Similar Post: App crashes when the user changes the device language and My app crashes when my phone's language is ...
0
votes
1
answer
22
views
Custom font for Alert Dialog message
I'm using the following style for my custom AlertDialog. The specified font "myfont.tff" is applied on the AlertDialog title and buttons, but not on the AlertDialog message. What do I need ...
0
votes
1
answer
25
views
using setview under AlertDialog with long text
I've been trying use setview with an added button under an AlertDialog along with long message text and positive/negative buttons. Whatever I do, either I don't see the positive/negative buttons or ...
0
votes
0
answers
99
views
android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running
While creating an alertdialog from within the Adapter class, "android.view.WindowManager$BadTokenException: Unable to add window -- token null is not valid; is your activity running?" I'm ...
0
votes
0
answers
9
views
CancelListener on Dialog Not Work Java Android? How to Use It?
I want to create a Fragment Dialog such as BottomSheetDialog, AppCompactDialog, and so on. And when dismissing the dialog, I want to raise a question first. Where does the dialog proceed to dismiss or ...
0
votes
1
answer
32
views
Android deep code communication with user via AlertDialog
In Android game (written in Java) I have an activity that's calling service and service calls a manager that checks certain values.
Activity code looks something like this:
public void performACheck() ...
0
votes
0
answers
22
views
AlertDialog - How I can make OutlinedTextFields prepopulated when user opens the AlertDialog?
I'm working on a mobile app where users can create reports by entering basic information and specifying a location on Google Maps. Users open AlertDialog by clicking on the FAB. After users enter the ...
0
votes
1
answer
35
views
Change the Text of AlertDialog positiveButton after clicking
I have an AlertDialog that has a positive button (OK) and a cancel. When pressing OK, I have a process that should take around 10s to finish (downloading an image from a URL and then showing it on the ...
2
votes
1
answer
133
views
Cannot set dimAmount for BottomSheetDialogFragment in Android 13+
BottomSheetDialogFragment accepts only dipAmount of 1.0f (non-transparent black background), 0.99f and less are fully transparent background, this seems to be affecting only API 33+. Styles.xml ...
0
votes
0
answers
83
views
How to get image from gallery in a non activity/fragment class? - koltin
I'm using the requestForLoadImage which is an ActivityForResultLauncher<Intent> built in MainActivity to get image from gallery.
I've passed the requestForLoadImage to the productAlertDialog ...
0
votes
2
answers
30
views
HowTo prevent AlertDialog.Builder cancelOnTouchOutside
With ordinary dialog we can use cancelOnTouchOutside
but with
AlertDialog.Builder we can't use it
Is there a way to do it?
AlertDialog.Builder alert = new AlertDialog.Builder(this);
alert.setTitle(...
0
votes
1
answer
432
views
How to put an image at the End of a Row in Jetpack Compose with following dimsensions in android?
I have created a Row inside a Row, the dimensions specified for padding for inner row should be followed as specified. So, I want to put two images inside the inner Row with one image at the Start of ...
0
votes
2
answers
25
views
When wrapping IconButton with a container it doesn't contain the entire icon, & I have to press on the container in particular so the onPressed works
In the following code and as shown in photo, the container wrapping the IconButton doesn't contain the icon, and for the dialog to be closed I have to click on the container (blue area) but when ...
-1
votes
1
answer
24
views
Why has my Android app suddenly stopped displaying dialogs?
My app displays dialogs, warning the user of various situations and requiring user input. These dialogs were all working fine, but now they are no longer displaying; after upgrading from Android ...
-1
votes
1
answer
25
views
The argument type 'Context' can't be assigned to the parameter type 'BuildContext'. error
I am creating Alert dialog widget but it is giving this error.
Where am I going wrong please help
error: The argument type 'Context' can't be assigned to the parameter type 'BuildContext'.
CODE:
`...
4
votes
0
answers
238
views
AlertDialog in Android Api 29 used to dim the screen when it was shown, but in Api 34 instead it creates a shadow around the dialog
AlertDialog in Android Api 29 used to dim the screen except for the dialog when it was shown, but in Api 34 instead it creates a shadow around the dialog.
The AlertDialog in android used to dim the ...
0
votes
0
answers
14
views
MyAdapter and ArrayAdapter issues in Fragment
Here are my codes:
MyAdapter adapter = new MyAdapter(this, n,s,t,image);
list_view.setAdapter(adapter); //my other problem
ArrayAdapter arrayAdapter = new ArrayAdapter<String>(this, ...
5
votes
1
answer
1k
views
Android 14 outside of AlertDialog doesn't get dim
On Android 14 Upside-down cake emulator, when showing an alert dialog, outside of alert dialog doesn't get dim. How can I get dim just like other android versions?
I tried:
alertDialog.window?....
0
votes
1
answer
95
views
How can I update a LazyColumn's listitems inside an AlertDialog from a ViewModel properly in Jetpack Compose? - Android
I'm trying to make a recipe app for practice that saves Recipes and Ingredients in a ROOM database. The recipes are shown in the main screen, and there is a FloatingActionButton that lets you add a ...
0
votes
0
answers
47
views
Flutter alertDialog does not show semantics when triggered in front of the webview
I am calling showDialog with AlertDialog() and I want buttons to have their own semantics as well as title and description. It works fine when there is no webview below it, but when I have ...
0
votes
1
answer
73
views
Android Material UI dialog, keep the dialog open when the button is pressed
I want my dialog to stay open when I press the OK button, because I want to make the Alert Dialog the place to input the verification code. Is there a way to keep the Alert Dialog from closing?
...
3
votes
1
answer
700
views
Android 14 dialog gray scrim disappears
I recently tried the Android 14 emulator (API Level 34) and verified how dialogs look like on the new OS.
At first sight I noted that the dialog's scrim (used to be dark transparent gray) disappeared.
...
0
votes
0
answers
145
views
Android Compose Screen moves AlertDialog when onscreen keyboard appears
I have a Compose screen in my app that will show a Material3 AlertDialog when the user clicks a 'next' button. In that UI we ask if they want to add a label before they click the confirmButton and ...
0
votes
1
answer
126
views
How can I get button-clicks from an Android dialog fragment back to the fragment (not an activity) which shows the dialog?
When the user commits a certain error in a certain fragment, a dialog is shown from a dialog fragment. This works great! However, I cannot figure out how to get the info on which button (positive or ...
0
votes
1
answer
54
views
Displaying Android AlertDialog immediately
I noticed that AlertDialog in Android does not show immediately. The AlertDialog could be rendered after all the codes have fully run it's course and the dialog pops up which is too late in the UI ...
0
votes
0
answers
77
views
How to create a custom dialog in android
I want to create a view like this
Custom dialog image
I am wondering if I can use a dialog to create this view. If it is possible to use a dialog, how can I position it to the bottom and make its ...
0
votes
0
answers
25
views
Abount Java Code Design Pattern - Android studio
I hava some question in Code Design Pattern. I want to use OOP desgin to my code. but I don't how to use that...
Example:
I need a public AlertDialog,but I always use public funtion,likes:
public void ...
1
vote
1
answer
126
views
How to do Alert dialog in Android Kotlin return boolean value
I want to make static function with Alert dialog which return boolean value.
In C# it looks like:
DialogResult dialogResult = MessageBox.Show("Sure", "Some Title", ...
1
vote
1
answer
778
views
How to keep a view above a bottomsheet/dialog
I'm basically trying to implement a custom notification/toast system in my app with a different behavior than a native toast (that's why I'm not using a custom native toast). The way I want to do it ...
0
votes
1
answer
21
views
Android date picker result can't able to set text to text view in AlertDialog.Builder
I am using DatePickerDialog.OnDateSetListener to set date to text view. But when trying to set text to text view a null object reference occurs.
code for Showing AlertDialog.Builder
void ...
2
votes
2
answers
175
views
How do I safely re-create my activity when I switch between dark and light mode when using Fragment dialog?
I have a dialog fragment that displays an image whose bytecode is passed to the constructor.
When the dialog is appeared and I am in dark mode and try to change the mode to light one and I come back ...
0
votes
1
answer
106
views
Android change color of AlertDialog elements
I would like to change the colors of the AlertDialog elements using only xml.
The elements I want to change using xml are:
Background color of the AlertDialog
Url text color
Line color of textInput ...
5
votes
3
answers
692
views
Dialog Scrim Is Not Shown In Emulator
I have a problem in my emulator. My emulator is not shown AlertDialog Scrim. I don't know why. I was try to reset my emulator, changing API level but not solve problem. How can I solve?
Number 5 is ...
0
votes
1
answer
179
views
Dialog max width after screen rotation
I need to support both landscape and portrait screen sizes and want my Dialog to fit the whole available width. This doesn't happen if I use default settings (Dialog's width is same in landscape and ...
0
votes
1
answer
231
views
Using Style or Button of an Alert
In my .NET MAUI App, I created my own Popup display it via
Application.Current.MainPage.ShowPopupAsync(customPopupPage);
As this looks like a view you get when opening a Picker, I was thinking ...
1
vote
2
answers
70
views
When I use Alert.Dialog the application crashes
I want to show prograssbar with the help of Alert.Dialog while saving data to database. but after registration the program crashes.
A method that gives an error after running:
private void saveData() {...
0
votes
0
answers
50
views
Customizing 2 buttons separately in AlertDialog (Android Studio, java)
I'm new to Android development, and I'm making my first java app - a simple tic-tac-toe game in Android Studio.
When someone wins or there is a draw, the app displays a AlertDialog message, with title,...
-1
votes
1
answer
54
views
AlertDialog in seperate class to use in entire project
I tried to use a seperate class in which Alertdialog is called for showing message. But app crashes without any error
package com.example.library;
import android.app.AlertDialog;
import android....
0
votes
1
answer
52
views
Is there a way I can setAdapter and setMessage at the same time for MaterialAlertDialogBuilder?
I want body text to appear above a list of views inside dialog from MaterialAlertDialogBuilder. I tried setting body text and adapter but it only resulted in showing the body text, ex1.
...
0
votes
0
answers
38
views
How to attach dialog to specific View
I have a screen with many elements. And I need to show dialogs near those elements. AlertDialog out of the box allows me to show dialogs on the bottom or top. But I need to attach them to the ...
1
vote
1
answer
2k
views
How to change the button size to full width in compose using Material 3 Alert Dialog
Hi I am creating a Alert dialog on some action, I need to get the Confirmation button to full width below is my code, Kindly look over it on achieving the full width of button and also , say if I get ...