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

alertdialog listview uncheck

I create AlertDialog with ListView, and adapter have element CheckAll/UncheckAll elements programmatically. This works. But when I'm checking item by touching screen, then push checkall, then uncheckall the checked element stays checked. …
silentnuke
  • 2,622
  • 1
  • 18
  • 17
1
vote
2 answers

How to apply backround color and theme to alert dailog builder

I have a problem in alert dialog builder. I can't change alert box background color. Please resolve my problem. I write some code for alert builder to show alert message and icon, but I can't set background: protected Dialog onCreateDialog(int id)…
NareshRavva
  • 823
  • 3
  • 21
  • 50
1
vote
5 answers

Dismiss Dialog Android

I am using this alert dialog: public void displayAlert() { new AlertDialog.Builder(getActivity()).setMessage(R.string.invitenotice) .setTitle("Invite Notice") .setCancelable(true) …
Fofole
  • 3,398
  • 8
  • 38
  • 59
1
vote
4 answers

why adding the class name in AlertDialog.Builder parameter?

the AlertDialog.Builder constructor takes a Context as its parameter : AlertDialog.Builder (Context context), and i found an example where the parameter is not only this but : new AlertDialog.Builder(MyClassName.this); Why that? Also, i've already…
Paul
  • 6,108
  • 14
  • 72
  • 128
1
vote
0 answers

How to encode string so dialogue would show html links etc

Everything works nicely if i keep the text with html links in the strings file and use: View view = View.inflate(mContext, R.layout.general_info, null); TextView textView = (TextView) view.findViewById(R.id.message); …
user975869
  • 275
  • 1
  • 5
  • 12
1
vote
1 answer

How do I get edittext value from a custom AlertDialog where retrieval of values is not in the onClick?

What I am trying to do is to create a custom dialog that overrides an AlertDialog. What it is supposed to do is get some text (at least 2 strings) and then for each of those strings it is supposed to be able to get more information, but I want to do…
1
vote
2 answers

Android: Context Menu to Alert dialog

What do i need to change to make this display into alert dialog? @Override public void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo) { super.onCreateContextMenu(menu, v, menuInfo); …
Kev
  • 173
  • 1
  • 4
  • 12
1
vote
1 answer

how to use handler in my program?

in my application i am using a canvas and some objects on that.this implementation is done in a separate thread called mythread.in a particular scenario i want to display an alert dialog on my screen.first itried to implement this by using the given…
andro-girl
  • 7,989
  • 22
  • 71
  • 94
1
vote
4 answers

Android : Activity cycle after Force Close

In my application some times it may take large time to load some values( like retrieving driving directions from google maps).This results in the launch of the "Wait" alert dialog.I wish to know what happens when the Force close button is clicked? I…
freshDroid
  • 509
  • 1
  • 5
  • 16
1
vote
3 answers

how to open alert dialog box for second time without running program 2nd time?

In my program I have used an alert dialog box on onclick event. But after running my program on event onclick the alert dialog box opens and allows filling information in it. and then on click of ok button alert dialog if condition is matched than…
Khan
  • 7,585
  • 3
  • 27
  • 44
1
vote
0 answers

App crashes on selecting Spinner in a website openend in a WebView within the App

I have a WebView in one of the tabs in TabView. The webView loads a specific url which contains a spinner. The action listener and spinner is triggered from the server side embedded in the url. webview = (WebView) findViewById(R.id.webview); ....…
1
vote
2 answers

Alert Dialog and ASync Task

i am trying to use Alert Dialog Box and Async Task in the activity and am getting the following error Caused by: java.lang.RuntimeException: Can't create handler inside thread that has not called Looper.prepare() Code: public class loginTask…
Harsha M V
  • 54,075
  • 125
  • 354
  • 529
1
vote
2 answers

Behavior of code with alert dialog

I just wanted to understand if my method has some code that shows an alert dialog and after that some other code, then when the alert dialog is shown and I have not clicked any button, will my code below the alert dialog.show() line wait for the…
Sush
  • 6,839
  • 1
  • 18
  • 26
1
vote
1 answer

How to make alert box return integer values on selected multple items?

I am building an alert box which has a char array of elements which is used as data for multiple selection checkbox. My question is how to make this alert box return the value as 1,2,3 depending on the selected item order? ie. if i select mercur and…
Froyo
  • 455
  • 1
  • 8
  • 21
1
vote
1 answer

Android Service and AlertDialog Activity

I'm trying to build a service which runs in the background and pops up an alert dialog even when you are not in the application screen currently. I'm using an alarm manager. My problem is that when my alert dialog activity pops up - it shows the…
ohadinho
  • 6,894
  • 16
  • 71
  • 124