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

Combine Espresso and Room test

I'm currently creating some unit test for my app and currently learning about Espresso. I wanted to test an AlertDialog which adds something to a Room database though a ViewModel. The ViewModel is fetched from the parent Activity. I wanted to know…
rminaj
  • 560
  • 6
  • 28
1
vote
1 answer

How to pass data from context menu to alert dialog in Android?

The method below happens when an item in a ListActivity is long pressed. The idea is to delete that item from the database and for that I need to call mNotesAdapter.deleteNote(ID). Which works fine if I don't use an AlertDialog; but I should use one…
rfgamaral
  • 16,546
  • 57
  • 163
  • 275
1
vote
1 answer

How to send result of AlertDialog fragment using viewModel?

I have a custom dialog fragment that communicate to its parent using intent. (I've copied it from somewhere). This uses old framework for communicating that some of its methods such as onActivityResult, getTargetFragment() has been deprecated now. I…
1
vote
0 answers

Dialog didnt want to hide even the state has false in Jetpack Compose

i have a alert dialog that show and close by boolean from the state, the problem is when i click close button and change the state to false, the dialog didnt want to hide. i've logged the state when i close button, and the result from logged state…
1
vote
1 answer

Jetpack Compose Snackbar above Dialog

How can a Snackbar be shown above a Dialog or AlertDialog in Jetpack Compose? Everything I have tried has resulted in the snack bar being below the scrim of the dialog not to mention the dialog itself. According to Can I display material design…
1
vote
4 answers

Size of button in alertdialog

how can i change the size of button in alertdailog in code without using xml ? I'm not using view .. Thank you The code : alertbox3.setNeutralButton("Cancel",new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int…
Dev
  • 505
  • 2
  • 8
  • 16
1
vote
1 answer

Uploading Files to ftp server by selecting an account?

I would like to upload files to ftp server by choosing account using Alert Dialog. The Alert Dialog show when the Activity starts. I know how to create Alert Dialog when activity starts. But, i don't know get the values from database within the…
user905216
1
vote
1 answer

WebView is not getting display in the AlerDialog

I am trying to display 'WebView' in 'AlertDialog'. For that I referred one of the question posted here: Displaying WebView in AlertDialog It successfully opens the dialog window. But I dont know some how its not showing the web content. This is my…
YuDroid
  • 1,599
  • 5
  • 22
  • 44
1
vote
1 answer

LinearLayout of Activity doesn't update after AlertDialog is closed

With the following code I am able to successfully remove a View from a LinearLayout when clicking for a longtime on a button: button.setOnLongClickListener(new View.OnLongClickListener() { @Override public boolean…
1
vote
0 answers

Unknown yellow ripple effect on Dialog item click

I am getting a yellow square ripple effect when clicking on Dialog clickable items but I have set the background borderless, why the yellow color? I have not done anything. DIALOG: Dialog dialog = new…
coderror
  • 49
  • 1
  • 5
1
vote
1 answer

How to set the position of text message in alert dialog

How to set the position of text message in alert dialog?. I want it to be in the middle
Dev
  • 505
  • 2
  • 8
  • 16
1
vote
1 answer

How can I write alert dialog in my kotlin-compose project?

I'm trying to make a dictionary app. There is a dictionary room database where users create their own dictionaries. I show the dictionaries added by the users on the screen and I want the users to delete these dictionaries whenever they want. But…
1
vote
1 answer

How to load Jetpack Compose Alert dialog in a fragment is written in Java code?

I know we can use composeView to have compose code in the legacy code, but is there any way to use Jetpack Compose Dialog inside java code (especially in a fragment)? I saw this post Possible to use/layout a compose view in and Activity written in…
1
vote
0 answers

EditText input element hide in the android alert dialog when soft key pad visible

In my new app I want to give a pop to add password to login. It's having a EditText Input,Title and Message. Edit text gave as, final EditText input = new EditText(view.getContext()); Issue is when soft keypad pops out edittext becomes…
1
vote
1 answer

How do I alter the items listed in an AlertDialog?

In my app the user can add new cities. This should go as follows: Presses the 'add city' button from the menu. Selects a province from the list (AlertDialog) that appears. Selects a city from the list that is created based on the selected…
Dean
  • 8,632
  • 6
  • 45
  • 61