android-dialog

How can I display a dialog on Currently visible activity on android?

我只是一个虾纸丫 提交于 2019-12-08 17:18:45
问题 My Problem is similar to this 2 year old question, I am just re posting the same problem to get the updated answers, since a lot has changed in two years. I am developing for an app for GingerBread+ devices, I have many activities and in background I receive some data from the server. Now based on that data in some cases I need to show a Dialog to the user. Problem is How do I know which the current front most activity ? What I tried, I have tried giving the getApplicationContext() while

Dialog size does not match the background image

不问归期 提交于 2019-12-08 15:31:27
问题 I am using the Android SDK to make a game. Along the way, I need to display popup/dialog like any other game there user can upgrade or whatever. The problem I have is with the size of the dialog. I am using RelativeLayout and I am setting the background to the image I have with "wrap_content". The problem that the dialog is taking the size of the views inside (or the default dialog min size set by Android, whichever is bigger) NOT the background image. If I use fill_parent then it stretches

Android close custom dialog

徘徊边缘 提交于 2019-12-08 14:34:04
问题 I am trying to get the custom dialog to close on button press //set up dialog Dialog dialog = new Dialog(BrowseActivity.this); dialog.setContentView(R.layout.about); dialog.setTitle("This is my custom dialog box"); dialog.setCancelable(true); //there are a lot of settings, for dialog, check them all out! //set up text TextView text = (TextView) dialog.findViewById(R.id.TextView01); text.setText(R.string.app_help_message); //set up image view ImageView img = (ImageView) dialog.findViewById(R

Custom popup dialog with input field [closed]

廉价感情. 提交于 2019-12-08 14:20:03
问题 Closed . This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this post. Closed 3 years ago . How do I create popup input field for Android? I need Xml and Java Code. 回答1: try to use this custom popup dialog code main.xml <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="fill_parent"

Launch a custom dialog when clicked on notification

雨燕双飞 提交于 2019-12-08 00:03:54
问题 I want to launch an custom dialog when user clicks on the notification in the notification bar. I have already created the notification and the custom dialog class. But i do not know how to launch when user clicks it. All tutorials i searched launch a Activity and not a dialog. So, can anyone help me with this regard. Thank you. This is my Custom Dialog code public class custom_dialog extends Dialog { Context m_context; LayoutInflater mInflater = null; public custom_dialog (Context context,

Android Dialog Semi-Transparent

半腔热情 提交于 2019-12-07 23:48:30
问题 I am trying to make a semi-transparent Dialog so that you can see the game in the background before it starts. I've looked at this article on how to make it transparent, but there's nothing really on semi-transparent or if it's possible. android dialog transparent What I want is kind of like the picture he provides, but what the solution gives is the background of the dialog being completely gone. Thanks a lot! 回答1: Set the background color to #AARRGGBB where AA is the alpha channel. For

Show Long Message in AlertDialog

瘦欲@ 提交于 2019-12-07 17:12:16
问题 I am trying to display an lengthy message in Default AlertDialog with following code. public static void showAlert(String message, Context con) { AlertDialog.Builder dialog = new AlertDialog.Builder(con); dialog.setTitle(message); dialog.setPositiveButton(" OK ", new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int id) { dialog.dismiss(); } }); dialog.show(); } But when I pass long message Alert Dialog does not display full message. Can I align text of

DatePickerDialog OK button not getting the selected date

不羁的心 提交于 2019-12-07 10:01:12
问题 I have a simple DatePickerDialog that opens when an EditText is opened. After choosing a date and pressing OK, it should be displayed at the same EditText . It works fine if I only use the default dialog where it creates only one button - OK. I added a Cancel button, the problem is that it only gets the current date. Here's my code: private void showDatePicker(String birthdayStr) { // TODO Auto-generated method stub final Calendar c = Calendar.getInstance(); if (birthdayStr.equals("")) {

Android Dialog - Custom background instead of dimming or blurring

我是研究僧i 提交于 2019-12-07 04:48:29
问题 I have created my own custom dialog and it works fine but I want to change dimmed background to a custom pattern (for example an image file or a xml shape). How can I achieve that? Note that I do not want to change intensity of dimming but I just want, this dimming be replaced with a pattern 回答1: I found a workaround for this problem, I derived this from @vipul mittal answer, I should set dialog theme as following: <item name="android:windowIsFloating">false</item> <item name="android

Prevent ProgressDialog from getting dismissed by onClick

主宰稳场 提交于 2019-12-07 04:03:57
问题 I' using ProgressDialog to show the user that he has to wait and to make the surface of my app "untouchable" while the user has to wait. I added a Button to the progressDialog which should start some actions if certain conditions are true. The problem is that everytime the user press the button the progressDialog gets automatically dismissed. Even if no action is triggered. How can I prevent the progressDialog from getting dismissed when onClick is called? thx & regards EDIT: connectingDialog