android-alertdialog

Dialogbox bug (Xamarin Android)

时光总嘲笑我的痴心妄想 提交于 2019-12-24 09:48:46
问题 I have the following code which passes the intent whether SELECT_IMAGE or REQUEST_CAMERA. In this case, after adding an image from the gallery, an item will be added on the listview. protected override void OnActivityResult(int requestCode, Result resultCode, Intent data) { // ................ // if (resultCode == Result.Ok) { if (requestCode == REQUEST_CAMERA) { // ...................// } else if ((requestCode == SELECT_FILE) && (data != null)) { Android.Net.Uri uri = data.Data; string

Custom AlertDialog not showing

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-24 09:35:25
问题 I have a TextViewer Activity , that has a button, and when I click on it I want to popup an AlertDialog with list. I followed this link but it does not work (no popup). I believe the context is wrong. I used the following code: protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.resources); ImageButton btnlist = (ImageButton)findViewById(R.id.list); btnlist.setOnClickListener(new View.OnClickListener() { public void onClick (View v)

How to dismiss Custom Alert Dialog

廉价感情. 提交于 2019-12-24 06:40:51
问题 i have a Custom Alert Dialog , i have a imageView For close Dialog but i don`t know how to do it. I try to do it by dismiss or cancel, but it does not work public void onClick(View v) { final AlertDialog.Builder dialog = new AlertDialog.Builder(context); final View viewLayout = mInflater.inflate(R.layout.listview_addstudent_items , null); dialog.setView(viewLayout); ImageView closeIcon_img = (ImageView)viewLayout.findViewById(R.id.item_img_close); closeIcon_img.setOnClickListener(new View

Custom Dialog Button called inside RecyclerView's onBindViewHolder

会有一股神秘感。 提交于 2019-12-24 05:35:41
问题 I'm trying to have the OnClick of the Custom Dialog remove and update the item clicked from RecyclerView. final Dialog rightDialog = new Dialog(context1); ... TextView textOKRight = (TextView) rightDialog.findViewById(R.id.text_ok); textOKRight.setText("NEXT"); textOKRight.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View v) { // MainAdapter.ViewHolder ccd = new MainAdapter.ViewHolder(itemView, listener); // ccd.removeCaller(); rightDialog.dismiss(); } });

Alertdialog creating exception in android

梦想的初衷 提交于 2019-12-24 03:43:16
问题 i am using Alert-dialog in Asynchronous task onPostexecute method.but my problem is when i come back to previous activity before the Asynchronous task completes.The Alertdialog (alert.show) is giving the following exception.The Alertdialog will appear on window but why this is not showing in other screens when i switch back. Logcat Error: 02-27 05:03:05.283: E/AndroidRuntime(827): FATAL EXCEPTION: main 02-27 05:03:05.283: E/AndroidRuntime(827): android.view.WindowManager$BadTokenException:

set background image alertdialog

社会主义新天地 提交于 2019-12-24 02:14:45
问题 I am trying to create a customized AlertDialog with Buttons and RadioGroup . I want to have a background image saved in my drawable for this AlertDialog . AlertDialog.Builder alert = new AlertDialog.Builder(AutoGenerate.this); alert.setTitle("Select color"); Is there any alternative option like alert.setbackgrounddrawable(R.drawable.img) ? 回答1: Custom dialog with custom view. Dialog d = new Dialog(AutoGenerate.this); d.requestWindowFeature(Window.FEATURE_NO_TITLE); d.setContentView(R.layout

Outgoing call don't start

我们两清 提交于 2019-12-23 23:40:02
问题 I'm writing an application that: Intercepts an outgoing call Shows a dialog asking whether the call is "personal" or "business" ("Aziendale" in italian) If "personal" , makes the call with the given number If "business" , prepends a suffix to the number (for example 4888 - just temporarily in my code) The point is: as I don't know how to make the call wait for the user's choice, I: Close the incoming call with setResultData(null) Show an alert dialog After user press one button make the call

What's the best way to have reusable dialog boxes?

我与影子孤独终老i 提交于 2019-12-23 18:04:32
问题 What's the best way to create reusable dialog boxes in Android? Reading through the Dialog dev guide, I know I can use AlertDialog.Builder(this); in one of my Activity s, but what if I want to use this in multiple Activities? If this was some other class I would extend it, so MyDialog extends AlertDialog , but then I cannot use the Builder . Any suggestions? 回答1: Crate one class file like as AllMethod.java and add this code in that class file. public static void showAlert(Activity act, String

Using latest material outlined buttons with alertdialog

假如想象 提交于 2019-12-23 17:54:37
问题 I want to use new material outlined buttons with default alert dialog. I have created style in style.xml as below <style name="OutlinedButton" parent="Widget.MaterialComponents.Button.TextButton"> <item name="strokeColor">@color/colorAccent</item> <item name="strokeWidth">2dp</item> </style> <style name="MaterialDialogStyle" parent="Theme.MaterialComponents.Dialog.Alert"> <item name="android:textColorPrimary">@color/colorAccent</item> <item name="colorAccent">@color/colorAccent</item> <item

Android Alertbox How to dismiss all open Alertbox without any references

隐身守侯 提交于 2019-12-23 16:09:58
问题 I have a restart option in my game. but the problem is that there may be some open alertdialog in the existing activity when I press restart. When I press restart I want to dismiss all open Alertdialog(if any). I do not have any reference to opened up alertdialogs(Can be o,1 or more than one). Is there any way I can dismiss all the opened up alertdialogs in the activity at any time without having any reference to it ? 回答1: First you could assign all your dialogs to a member variable, e.g.