android-dialog

Custom dialog hasn't divider under the title

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-14 02:41:14
问题 At the official documentation there is an article of how to create custom dialogs. And there is also a picture of result dialog which have gradient border under it's title. When I copy this code to run it on my machine and look at the results I get the dialog without gradient divider between the dialog's title and it's content: Is this normal behavior and if it is, tell me how can I add divider by myself through the code, or using styles mechanism? 回答1: Yes this is a normal behavior for

Prevent dialog to be opened multiple times when resuming activity

坚强是说给别人听的谎言 提交于 2019-12-13 13:04:36
问题 In my Android application, in order to ask the user if he/she wants to resume a current game, I display a dialog saying "Do you want to resume current game? Yes - No" on the main game activity. The thing is that if I resume various times this activity without answering the dialog, then I get several dialogs, on top of each other, which is obviously not my goal. I could easily avoid this behavior using a Boolean var, but I was wondering if the Dialog class had a kind of option preventing to be

android custom dialog background

落花浮王杯 提交于 2019-12-13 12:04:28
问题 I need to show a custom dialog in my Android application. Standard AlertDialog design is unacceptable. Android docs say: Tip: If you want a custom dialog, you can instead display an Activity as a dialog instead of using the Dialog APIs. Simply create an activity and set its theme to Theme.Holo.Dialog in the manifest element: That's it. The activity now displays in a dialog window instead of fullscreen. Sounded promising. I did it, but transparency does not work! Background is always grey:

How to remove title from custom dialog?

有些话、适合烂在心里 提交于 2019-12-13 07:57:12
问题 I implemented a layout in order to be my custom dialog layout like this: <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:layout_width="fill_parent" android:layout_height="wrap_content" android:background="@color/gray_back" xmlns:android="http://schemas.android.com/apk/res/android"> <LinearLayout android:id="@+id/mainLayout" android:orientation="vertical" android:layout_width="fill_parent" android:layout_height="wrap_content" android:layout_marginBottom="20dp" android:layout

Results from a DialogFragment to an ActivityFragment

只愿长相守 提交于 2019-12-13 04:17:27
问题 I have a DialogFragment , that depending on how it's called, will either pop up a dialog, or start an Intent, based off of results from the dialogFragment . Essentially, my DialogFragment is a list of activities, which depending on how I call I will want more information about the activity, or to start the activity. Ideally, I would like to have something akin to the onActivityResult to handle these results, in my base class. Doing some research has indicated that if I was using a Fragment,

DialogFragment not appearing

若如初见. 提交于 2019-12-13 03:54:14
问题 For some reason, a DialogFragment that I've just created won't appear whenever I try to launch it from a click event. Why does the dialog not have a view, when my view has been clearly set builder.setView(rootView) ? Fragment does not have a view click event to launch DialogFragment holder.myButton.setOnClickListener { val dialog = MyDialog() val manager = (holder.itemView.context as FragmentActivity).supportFragmentManager dialog.show(manager, "example") } DialogFragment class MyDialog :

starting a service from dialog box in android

放肆的年华 提交于 2019-12-12 23:38:14
问题 I'm trying to start a background service from a pop-up dialog and it's just doesn't work for me this is the code for opening the dialog box: reportWrongLang.setOnClickListener(new OnClickListener() { @Override public void onClick(View v) { FragmentManager fm = getFragmentManager(); ReportWrongLangDialog Dialog = new ReportWrongLangDialog(imageInfo.getParam("imageId")[0], getApplicationContext()); Dialog.show(fm, "are_you_sure_dialog"); } in the ReportWrongLangDialog i am saving the appContext

Android Multichoice Item Dialog with Search Functionality

不打扰是莪最后的温柔 提交于 2019-12-12 22:19:21
问题 In my Android application I have a multi choice item dialog (similar to that shown in the image) that has a large number of items. So I plan to add a search box and as user types, the items are filtered accordingly. What is the best way to do this? Thanks 回答1: I did it like this, works fine for me. private static final class ListItemWithIndex { public final int index; public final String value; public ListItemWithIndex(final int index, final String value) { super(); this.index = index; this

Offer foreground download to user with possible dialog

落爺英雄遲暮 提交于 2019-12-12 18:06:11
问题 I'm fighting with usability design. Let's have application which has only one permission, android.permission.INTERNET . I want to download image from remote URL (where I cannot control server-side), but download it so user can choose whether and where download that file. Displaying dialog for process approval and/or choosing final destination. I have considered these solutions: DownloadManager using setDestinationInExternalPublicDir Two bugs, I don't want to add WRITE_EXTERNAL_STORAGE

Android Complete action using keeps showing after default has been selected

落花浮王杯 提交于 2019-12-12 16:21:48
问题 I'm running into a weird issue in my app development. At some point in my app, it would call an Intent (Intent.ACTION_SEND) to launch Gmail, and the "Complete action using..." dialog will appear. Even though I check the default box at the bottom and select Gmail, the next time my app calls for the Intent, the Complete action using dialog keeps appearing. I can not get it to go away even though I already selected the default app to launch. Any ideas why? Example of the Intent private void do