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
0 answers

Application keep crashing, when i try to show() AlertDialog from a ForegroundService

I try to build an app, where you type the Username and Pass in the MainActivity, which will start a ForegroundService and in an endless loop keep sending User and Pass to a PhP server. App is working fine, keep receiving the response and service…
1
vote
1 answer

Is it possible to change AlertDialog message only based on condition met?

E.g. I have similar code to this post Show AlertDialog if some condition is met if (condition) { AlertDialog.Builder(requireActivity()) .setTitle("Internet") .setMessage("Internet ON") …
1
vote
1 answer

How can I make the android navigation bar transparent when React Native Modal is shown?

I use React Native CLI. With Alert, the full screen of the app is covered and the navigation bar becomes transparent. However this does not happen with a Modal, which does not cover the navigation bar. (and it looks a bit bad). I don't understand…
1
vote
2 answers

ScrollView too long therefore produce white borders

I'm still working on my android application and I still struggle with XML ans scroll views. I want to display an AlertDialog which contains: A JPEG image a the top of the window two EditText under the picture, at the same Y coordinate. (and both…
Symtox
  • 77
  • 5
1
vote
0 answers

How to make Alert Dialog is reusable / customizable for another new Alert Dialog

can u guys help me with this coding? I'm quite confused about how to implement final and required parameters and display them with input. I want to create one file dart which is GoAlertDialog (go_alert_dialog.dart) that can pop out a warning icon,…
1
vote
0 answers

Prevent from Android soft keyboard to push alert dialog up

Do you know any way to prevent the alert dialog from being pushing upward when the keyboard opens (when the user insert text to edit text)? If think I have tried every posible setting for android:windowSoftInputMode but it keep happaning.
nirkov
  • 697
  • 10
  • 25
1
vote
4 answers

Dialogbox on List onListItemClick() method .. It give BadTokenException

I want to setup the Dialog on list.When the user select the list item, it should show alert box with "Yes" /"No".I have tried like this. but it give BadTokenException @Override protected void onListItemClick(ListView l, View v, int…
Piraba
  • 6,974
  • 17
  • 85
  • 135
1
vote
2 answers

Android: Why does this dialog popup twice?

I have a dialog that checks to see if the internet is on. If it isn't on, I display a pop-up giving you the option to turn data on or exit the app. If you choose to turn data on it will take you to the settings page to turn data on. Here is the…
Nick
  • 9,285
  • 33
  • 104
  • 147
1
vote
1 answer

why Radio Button in Alert Dialog doesn't update?

So I try to use Radio button to choose some option inside Alert dialog. It looks like this: . The radio button remains inactive when I click on it. But when I close the alert dialog and open it again, the radio button is activated. For example, I…
Flitzcore
  • 166
  • 1
  • 11
1
vote
2 answers

How to add progressbar (circle) and horizontal progress bar in the same activity in Android

Hi I need to do something like this : I know,it's from an iphone application,but I want to add progressbar (circle) at the center of page and horizontal progressbar at the bottom of the page,which will show the current downloaded bytes and the…
Android-Droid
  • 14,365
  • 41
  • 114
  • 185
1
vote
1 answer

Is there a way customize WindowManager.LayoutParams of an AlertDialog with Jetpack Compose

I tried showing an alert dialog over other apps. The permissions are granted. The Composable way is not…
1
vote
1 answer

Android - Set More Than One Color For Alert Dialog Text

I have a AlertDialog that has multiple lines of text. I am looking to have a different color for each line of text. Any ideas on how one would go about this? Is it possible to set a span foreground color to a string variable? API 30 // Create…
Pie
  • 856
  • 4
  • 12
  • 33
1
vote
1 answer

Custom AlertDialog Box is not displaying the layout form above and bottom?

I'm creating the custom alert dialog box for this I create XML design using ConstraintLayout. The problem is that when I display the alert dialog box on the button click it some layout de from above and the bottom is not shown. Here Is my XML…
1
vote
2 answers

Custom DialogFragment with AlertDialog returns EditText as ""

I have a custom DialogFragment that I'm using to capture user input that I will create a database entry with. I'm using EditText in an AlertDialog. I am trying to use a single activity for my application and the original tutorial I was studying…
1
vote
4 answers

Android: alert dialog in a class without activity

i have this class: public class DownloadImageTask extends AsyncTask { ImageFromWeb ifw; private String url; private final WeakReference imageViewReference; public DownloadImageTask(ImageView imageView) { …
John
  • 25
  • 1
  • 3