android-alertdialog

Softkeyboard not showing in AlertDialog for phone only

独自空忆成欢 提交于 2019-12-18 09:18:50
问题 Why the softkeyboard is showing only on the tablet is a mystery ! Here is the code that I have used. AlertDialog.Builder builder = new AlertDialog.Builder(CurrentActivityName.this); builder.setTitle(“Title”); builder.setMessage(“Message”); final EditText input = new EditText(CurrentActivityName.this); builder.setView(input); builder.setPositiveButton(R.string.allow, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { //my code } });

How to remove border in custom AlertDialog?

浪尽此生 提交于 2019-12-18 09:17:53
问题 I'm trying to create custom AlertDialog with an image text and buttons. When I display it I get a white border which looks horrible. How can I get rid of that white border? Here my custom Dialog: public LinearLayout customeLL; public void alertD() { AlertDialog ad; AlertDialog.Builder builder; Context mContext = getApplicationContext(); TextView a = new TextView(getApplicationContext()); a.setText("Test dialog"); ImageView img = new ImageView(getApplicationContext()); img

EditText inside AlertDialog always null

安稳与你 提交于 2019-12-18 09:01:05
问题 I've search over the threads but so far I have not found what I'm looking for. I created a custom Alert Dialog that show up and I can do almost anything with it. It custom dialog is made of 3 TextViews and 3 EditText but whenever I need to get the EditText I get a null component. From my xml file <TextView android:layout_alignParentTop="true" android:id="@+id/txtAccName" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Name" android:textSize="23dp" > <

Set default selected item of ListView Alert Dialog in Android

我怕爱的太早我们不能终老 提交于 2019-12-18 07:40:59
问题 I have created a dialog with a custom ListView that models a Spinner display, and originally it starts out with the value "Select Gender". When the dialog opens it prompts for a selection (just like a spinner). If the selection gets selected again, it shows the same options, but doesn't indicate which option has already been selected. Example: Default Value: "Select Gender" Dialog opens with no selection User selects: "Male" User reopens dialog... Dialog opens with no selection ( I'd like it

Android - How do i make this alert dialog scrollable?

こ雲淡風輕ζ 提交于 2019-12-18 05:43:49
问题 I am beginner in android and making my first android app. my 'About' menu item, when clicked shows an alertdialog with a really long message. I have been trying different methods to make it scrollable but i couldn't. I have tried reading different questions on stackoverflow but they didn't worked for me. Here is my alert dialog code. AlertDialog.Builder alertDialog = new AlertDialog.Builder(this); alertDialog.setTitle("Title"); alertDialog.setMessage("Here is a really long message.");

How to avoid black screen while invoking another activity in android?

喜你入骨 提交于 2019-12-18 05:11:47
问题 i am invoking an activity using intent from main activity. But during the invocation few system dialog boxes are displayed because of which a black screen is displayed. How can i avoid such black screen. 回答1: Please check the flags you are setting in your intent. If you have a finish(); or FLAG_ACTIVITY_CLEAR_TASK - a blank screen may show up on pre ICS devices as the current activity has been cleared before another activity is started. Intent intent = new Intent(getApplicationContext(),

How to avoid black screen while invoking another activity in android?

Deadly 提交于 2019-12-18 05:11:11
问题 i am invoking an activity using intent from main activity. But during the invocation few system dialog boxes are displayed because of which a black screen is displayed. How can i avoid such black screen. 回答1: Please check the flags you are setting in your intent. If you have a finish(); or FLAG_ACTIVITY_CLEAR_TASK - a blank screen may show up on pre ICS devices as the current activity has been cleared before another activity is started. Intent intent = new Intent(getApplicationContext(),

Is there a way prevent AlertDialog from closing with invalid inputs?

社会主义新天地 提交于 2019-12-18 03:55:27
问题 I am using a simple text field alert dialog with a positive and a cancel button. I want to validate my alert dialog and prevent the done button from closing the AlertDialog if the input is invalid. Is there any way short of creating a custom dialog to prevent the PositiveButton onClick() handler from closing the dialog if the validation fails? class CreateNewCategoryAlertDialog { final EditText editText; final AlertDialog alertDialog; class PositiveButtonClickListener implements

Android 6.0 Dialog text doesn't appear

末鹿安然 提交于 2019-12-18 03:03:10
问题 I updated my phone to Android 6.0 and I have these 2 problems with dialogs: 1)The title is shown but the messages isn't for alert dialog(SOLVED): new AlertDialog.Builder(context).setTitle("Title").setMessage("Message"); 2)Also custom dialog fragment's title is not shown(NOT SOLVED): getDialog().setTitle("Title"); There was not such a problem in lollipop or in older versions, the problem appeared only after updating my phone to marshmallow. How to solve the problem? 回答1: Use constructor with

Android Don't dismiss AlertDialog after clicking PositiveButton

≯℡__Kan透↙ 提交于 2019-12-17 23:02:11
问题 Can I just don't dismiss my AlertDialog after clicking PositiveButton? I would like to remain the dialog to show something update on my ArrayAdapter listWords. This is my code. AlertDialog.Builder sayWindows = new AlertDialog.Builder(MapActivity.this); final EditText saySomething = new EditText(MapActivity.this); sayWindows.setPositiveButton("ok", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int which) { say = userName + " Says: "+saySomething.getText();