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.

Filter by
Sorted by
Tagged with
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 ...
Ukeme Elijah's user avatar
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 ...
Danidu Jayathilaka's user avatar
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.
BobDidley's user avatar
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 ...
Ashish Rai's user avatar
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 ...
Neph's user avatar
  • 1,861
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 = ...
Hugo Jiménez's user avatar
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()) ...
Ömer Seyfettin Yavuzyiğit's user avatar
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 ...
mindoverflow's user avatar
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 ...
Sindu's user avatar
  • 151
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 ...
user avatar
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 ...
Eir's user avatar
  • 1,043
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 ...
Shlomi Agiv's user avatar
  • 1,183
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 ...
Mahmut Alperen Ünal's user avatar
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 ...
wiefunkdai's user avatar
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() ...
guest86's user avatar
  • 2,896
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 ...
alsabih's user avatar
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 ...
user avatar
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 ...
Артём Тарасов's user avatar
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 ...
Ali Saadati's user avatar
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(...
Lotfi's user avatar
  • 690
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 ...
Tejas Khartude's user avatar
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 ...
Alaa Mohamad Agha's user avatar
-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 ...
Chet's user avatar
  • 1
-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: `...
Serkan Samet Aklan's user avatar
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 ...
nithin_sikinam's user avatar
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, ...
Nisanur Turan's user avatar
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?....
Tieria's user avatar
  • 408
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 ...
bmartin042503's user avatar
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 ...
Razmik Gharibyan's user avatar
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? ...
NewbieMF's user avatar
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. ...
Lino's user avatar
  • 5,219
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 ...
Jeff's user avatar
  • 2,218
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 ...
user1260545's user avatar
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 ...
thotheolh's user avatar
  • 7,090
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 ...
HaBuiDuc's user avatar
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 ...
Xiang's user avatar
  • 26
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", ...
marios160's user avatar
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 ...
Buntupana's user avatar
  • 1,004
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 ...
kapil tk's user avatar
  • 225
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 ...
Mohamed Jihed Jaouadi's user avatar
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 ...
Paul's user avatar
  • 3,936
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 ...
emirhangulmez's user avatar
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 ...
Psijic's user avatar
  • 822
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 ...
OXO's user avatar
  • 606
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() {...
gkhnmr's user avatar
  • 13
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,...
Adamm's user avatar
  • 13
-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....
Beginner's user avatar
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. ...
haru_bleu's user avatar
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 ...
Helios's user avatar
  • 63
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 ...
arun's user avatar
  • 135

1
2 3 4 5
115