android-dialogfragment

How can I open a ProgressDialog on top of a DialogFragment?

ⅰ亾dé卋堺 提交于 2019-12-03 13:06:27
I have this Android activity/layout with a button. When I click this button, it opens a DialogFragment with 2 spinners. When the DialogFragment shows up, I need to populate these 2 spinners with items returned by a web service. So, while waiting for the service to return, I'd like to display a ProgressDialog over the DialogFragment I've just opened. The problem is I can't seem to make the ProgressDialog on top of the DialogFragment. I can see the ProgressDialog being shown behind the DialogFragment, is it possible to make the ProgressDialog being displayed over everything else? My code is like

How can I pass data from activity to the dialogFragment that activity invoked?

你说的曾经没有我的故事 提交于 2019-12-03 12:21:12
问题 In my application I have a form the user fills in. Pressing "save" the data will be saved to the local database. I want to add a confirm dialog for the user to review the details he entered before moving on, since those details are crucial. In my dialogFragment instance, I would have something like: "You are entering these details: A,B,C... do you confirm?" A,B,C are the values of my EditText fields in the activity which calls the dialogFragment How can I access those values from the

Textview: using the dialog title style: @android:style/TextAppearance.DialogWindowTitle

て烟熏妆下的殇ゞ 提交于 2019-12-03 11:09:25
问题 I am currently trying tu build my own DialogFragment theme. One of my requirement is to use an icon at the right of the title. First idea Simply using: this.getDialog().getWindow().setFeatureInt(Window.FEATURE_CUSTOM_TITLE, R.layout.dialog_title); But unfortunately, this line of code has no result. Second idea Provinding my own layout -this.setContentView()- with this textview: <TextView android:id="@+id/tvTitle" android:layout_width="fill_parent" android:layout_height="wrap_content" android

OnCancelListener is not called in DialogFragment

别等时光非礼了梦想. 提交于 2019-12-03 11:00:24
问题 I have a simple AlertDialog that displays a list of some items and upon clicking one of them, the clicked item is passed back to the enclosing Activity . I also want to perform some default handling when the user cancels the dialog (using the back button ) - more specifically, I want to pass an empty string to the activity in such case. However, if I put the dialog in a DialogFragment (from the compatibility package ), the OnCancelListener is not called when I close the dialog with the back

Show DialogFragment from another DialogFragment

一曲冷凌霜 提交于 2019-12-03 10:44:13
I have a DialogFragment that displays a list of options to the user, one of these options is "Delete" option, when the user presses the delete option I want to show another DialogFragment as a confirmation, unfortunately, the confirmation dialog doesn't show. here is my code First Fragment code public class ContactDialogOption extends SherlockDialogFragment { public static final String TAG = ContactDialogOption.class.getSimpleName(); public ContactDialogOption() { super(); // TODO Auto-generated constructor stub } @Override public Dialog onCreateDialog(Bundle savedInstanceState) { AlertDialog

Full screen DialogFragment

試著忘記壹切 提交于 2019-12-03 09:28:52
问题 I am trying to create a DialogFragment with a width of MATCH_PARENT so the dialog is nearly full screen (leaving the padding around the edges for the floating look). I have seen this solution Full Screen DialogFragment in Android but am trying to avoid the hack of setting the width to 1000dp. With my current layout, whether I use FILL_PARENT or MATCH_PARENT it seems to be setting the width and height to WRAP_CONTENT. <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

Hide to show and hide keyboard in DialogFragment

生来就可爱ヽ(ⅴ<●) 提交于 2019-12-03 07:35:39
In my dialog fragment, I am able to show the keyboard using getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT STATE_VISIBLE); but I am not able to hide it on dismiss . I've tried getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_HIDDEN); and getDialog().getWindow().setSoftInputMode(WindowManager.LayoutParams.SOFT_INPUT_STATE_ALWAYS_HIDDEN); neither of which work. I've also tried showing and hiding the keyboard using InputMethodManager inputManager = (InputMethodManager)context.getSystemService(Context.INPUT_METHOD_SERVICE);

How to create an Android Tabbed Dialog containing fragments?

我的未来我决定 提交于 2019-12-03 05:56:32
Can anyone point me to an example or show me how to create a simple Tabbed Dialog in Android where the contents of each tab are Fragments ? All the examples/tutorials I have found are about Fragments and Tabs, but nothing specific to DialogFragments . The documentation for FragmentTabHost shows how to create tabs within normal fragments using getChildFragmentManager() . I'm assuming this should also work when the fragment is a DialogFragment but when I try it I get: java.lang.IllegalStateException: Fragment does not have a view at android.support.v4.app.Fragment$1.findViewById(Fragment.java

Set status bar color from DialogFragment

十年热恋 提交于 2019-12-03 03:15:36
I'm creating an app which changes status bar color dynamically. My method in main Activity class works fine when called from any fragment. Fragments are placed in Activity pager: public void setStatusBarColorIfPossible(int color) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { getWindow().setStatusBarColor(color); } } However, in DialogFragment which is created in any fragment and made fullscreen, calling my method has no effect. Status bar is instantly black (as set in styles.xml) and I can't change it. public class AddOrEditWeekPlanDialog extends DialogFragment { @Override

How can I pass data from activity to the dialogFragment that activity invoked?

瘦欲@ 提交于 2019-12-03 02:57:09
In my application I have a form the user fills in. Pressing "save" the data will be saved to the local database. I want to add a confirm dialog for the user to review the details he entered before moving on, since those details are crucial. In my dialogFragment instance, I would have something like: "You are entering these details: A,B,C... do you confirm?" A,B,C are the values of my EditText fields in the activity which calls the dialogFragment How can I access those values from the dialogFragment? I am using: new ConfirmSaveProjectDetails().show(getFragmentManager(),"Confirm"); in my