android-alertdialog

Android Editable ListView (preference / dialog)

喜夏-厌秋 提交于 2019-12-13 06:46:46
问题 I need a editable list view with strings where items can be renamed added and removed. That should be - if possible in a preference view / dialog. What is the best way to implement that? Are there libs? - I didn't find any. My current solution is a multilined EditText dialog with one entry each line. 来源: https://stackoverflow.com/questions/36872319/android-editable-listview-preference-dialog

SMS Popup: AlertDialog does not show as I get a SMS message

限于喜欢 提交于 2019-12-13 05:39:02
问题 I see a lot of applications that do SMS popups. Why can't I get my app working? If a SMS message comes in, I would like it to popup on the screen. Here's my code: public class NotifySMSReceived extends Activity { private static final String LOG_TAG = "SMSReceiver"; public static final int NOTIFICATION_ID_RECEIVED = 0x1221; static final String ACTION = "android.provider.Telephony.SMS_RECEIVED"; protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState);

Alert dialog pops up even after dismissing it

你说的曾经没有我的故事 提交于 2019-12-13 05:36:50
问题 I have come across a typical problem and it seems strange to me. Details are something like this - On the activity in my app, there are edittexts and submit button. After filling the data in the edittexts, user can click submit button. After clicking submit button, based on the values that are entered by the user, either of the two alert dialogs are shown. One is success and the other one is failed. The thing is when the user enters invalid data and clicks submit button, the failed alert

Set title and (title) icon for a custom alert dialog

纵然是瞬间 提交于 2019-12-13 05:35:10
问题 I don't manage to set a neither a title nor a (title) icon to my custom alert dialog. My code: public class AddingFavoriteDialog extends AlertDialog { private OnAddingFavoriteListener onAddingFavoriteListener; private Context context; private GeocodingManager geocodingManager; private FavoritesActivity favoritesActivity; public AddingFavoriteDialog(Context context, OnAddingFavoriteListener onAddingFavoriteListener) { super(context, android.R.style.Theme_Dialog); this.context = context; this

Android: using AlertDialog when an item from a listview is long pressed

与世无争的帅哥 提交于 2019-12-13 05:18:44
问题 I have a list of items, created by a listview. I would like to long press one of the items on the list and an alert dialog to open up and depending on yes or no key on that dialog box I wan to set a global variable. The code that I am using is inside "MyActivity.java" and looks like this: ListView lv = getListView(); lv.setOnItemLongClickListener(new AdapterView.OnItemLongClickListener() { @Override public boolean onItemLongClick(AdapterView<?> av, View v, int pos, final long id) { final

how to remove extra space in android list alert dialog

我怕爱的太早我们不能终老 提交于 2019-12-13 04:25:46
问题 I am trying to display sample alert dialog with single choice items and facing problem with extra space after end of the list. Here is my code final CharSequence[] items = {"Red", "Green", "Blue"}; AlertDialog.Builder builder = new AlertDialog.Builder(context); builder.setTitle("Pick a color"); builder.setSingleChoiceItems(items, -1, new DialogInterface.OnClickListener() { public void onClick(DialogInterface dialog, int item) { Toast.makeText(context, items[item], Toast.LENGTH_SHORT).show();

Android alert dialog does not fit to image

廉价感情. 提交于 2019-12-13 04:23:11
问题 I have the following layout for alertdialog (I want alert dialog with only image in it) <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:orientation="vertical" android:layout_width="wrap_content" android:layout_height="wrap_content"> <ImageView android:layout_width="wrap_content" android:layout_height="wrap_content" android:id="@+id/imageImageViewId" android:src="@drawable/stub" /> </LinearLayout> The result I get is: http

how to use sharedPreferences from alertbox?

给你一囗甜甜゛ 提交于 2019-12-13 04:04:41
问题 Hi i created one media player. when my media player application load that time my dialog box also first display.... but now i am expecting only load once my dialog box..if i run 1st time in new device my application open dialog box otherwise show only video thumbnails......i confused please help me...... My coding: public class videothumb extends Activity { private final static Uri MEDIA_EXTERNAL_CONTENT_URI = MediaStore.Video.Media.EXTERNAL_CONTENT_URI; private final static String _ID =

AlertDialog - gap between custom view and title/buttons

﹥>﹥吖頭↗ 提交于 2019-12-13 04:00:08
问题 I use a custom view for an AlertDialog. In the emulator, there is some space above and below the customeView. If I set a title and buttons for the AlertDialog, I can see the gap between the title panel/button panel and the customView. How can I remove the gap? My code to open the AlertDialog: btnShowDialog.Click += (object sender, EventArgs e) => { var customView = LayoutInflater.Inflate(Resource.Layout.myDialog, null); var builder = new AlertDialog.Builder(this); builder.SetTitle("Title");

Android :Alert Dialog, Cancel Button

我们两清 提交于 2019-12-13 03:45:50
问题 I have a dialog with five CheckedTextView . When I open dialog and Click on some CheckBoxes and than I click Cancel Button. But when I open dialog again. The changes made is saved. Why? How to cancel what I clicked when I press Cancel button ? 回答1: Android creates the dialog box just once, and then reuses it instead of recreating it. Thus, your onCreateDialog method is called only once. The second time, you get the same dialog, with the same check boxes in the same state. To ensure that the