android-dialogfragment

Opening Fragment from a DialogFragment (replacing the Dialogs parent)

时间秒杀一切 提交于 2020-01-13 10:22:08
问题 Let's say I have Fragment A, from which I open a DialogFragment like this: FragmentActivity fragmentActivity = (FragmentActivity) view.getContext(); FragmentTransaction ft = fragmentActivity.getSupportFragmentManager().beginTransaction(); Fragment prev = fragmentActivity.getSupportFragmentManager().findFragmentByTag("dialog"); if (prev != null) { ft.remove(prev); } ft.addToBackStack(null); DialogFragment fragmentDialog = MyDialogFragment.newInstance(); fragmentDialog.show(ft, "dialog"); From

Opening Fragment from a DialogFragment (replacing the Dialogs parent)

心已入冬 提交于 2020-01-13 10:21:51
问题 Let's say I have Fragment A, from which I open a DialogFragment like this: FragmentActivity fragmentActivity = (FragmentActivity) view.getContext(); FragmentTransaction ft = fragmentActivity.getSupportFragmentManager().beginTransaction(); Fragment prev = fragmentActivity.getSupportFragmentManager().findFragmentByTag("dialog"); if (prev != null) { ft.remove(prev); } ft.addToBackStack(null); DialogFragment fragmentDialog = MyDialogFragment.newInstance(); fragmentDialog.show(ft, "dialog"); From

Update fragment on dialog fragment option selection

痴心易碎 提交于 2020-01-12 18:48:34
问题 I have fragment that on a component click pop-ups DialogFragment. This dialog fragment holds list of options. When an option from list is selected I want to notify fragment so I can run fields update procedure. I did something like this @Override public void onClick(DialogInterface dialog, int item) { updateSharedPreference(item); Log.e("ProfilePersonaListDialog", "Click on dialog, inside onClick"); OnCloseListDialogListener act = (OnCloseListDialogListener) getActivity(); act

Update fragment on dialog fragment option selection

江枫思渺然 提交于 2020-01-12 18:48:32
问题 I have fragment that on a component click pop-ups DialogFragment. This dialog fragment holds list of options. When an option from list is selected I want to notify fragment so I can run fields update procedure. I did something like this @Override public void onClick(DialogInterface dialog, int item) { updateSharedPreference(item); Log.e("ProfilePersonaListDialog", "Click on dialog, inside onClick"); OnCloseListDialogListener act = (OnCloseListDialogListener) getActivity(); act

How to set font size for text of dialog buttons

谁说胖子不能爱 提交于 2020-01-10 23:24:09
问题 I have an android app that uses some custom dialogs which are inflated from XML layouts. The contents of the dialog's view come from the XML layout, but the actual positive and negative buttons are added by calling the builder's setPositiveButton and setNegativeButton methods, so I have no control over (or at least don't know how to control) the styling of the buttons themselves. See the onCreateDialog method below from my LoginConfirmationDialog.java file which extends DialogFragment. It

DialogFragment disappears after device rotation despite applying common fixes

烈酒焚心 提交于 2020-01-06 13:49:06
问题 I have a DialogFragment that I launch when a user taps a menu item on the ActionBar. Everything about the Dialog functions properly - it launches just fine and it does everything I've set it up to do. Unfortunately, as soon as I rotate my device, the DialogFragment disappears. This seemed to be a common problem back in 2012 - I've scoured StackOverflow and tried all of the common fixes that have been posted in the last couple of years. This SO post in particular summarizes all of the

Updating a ListFragment based on Async Task result

孤街醉人 提交于 2020-01-06 12:34:13
问题 Scenario : I am having a list fragment which displays a list of friends. When an list item is pressed, I'm showing the details of the friend in a dialog fragment. Problem: In the dialog fragment, I'm having an option to delete the friend from my friend list (in a remote server) . I'm using Async tack to perform this. After returning from the dialog fragment, how should I update the 'old' friend list. How do I trigger a fragment 'reload'. Since the async task is not aware of the custom list

Updating a ListFragment based on Async Task result

六眼飞鱼酱① 提交于 2020-01-06 12:32:35
问题 Scenario : I am having a list fragment which displays a list of friends. When an list item is pressed, I'm showing the details of the friend in a dialog fragment. Problem: In the dialog fragment, I'm having an option to delete the friend from my friend list (in a remote server) . I'm using Async tack to perform this. After returning from the dialog fragment, how should I update the 'old' friend list. How do I trigger a fragment 'reload'. Since the async task is not aware of the custom list

How do I connect a button to a Dialog that will edit a TextView, within a FrameLayout, with a users input?

血红的双手。 提交于 2020-01-06 09:54:06
问题 I don't understand DialogFragment at all. How to create one, how to get the user input out of it, and set it into a TextView. I would like for the TITLE button, when clicked, to bring up a DialogFragment asking the user to enter the title of their Mood Board. The user enters a title. When they click the PostiveButton "Done", the user's title is set into the top left frame of the mood board, which has a TextView with a hint. Please! Ask questions, because I don't really understand the dialog

FLAG_SECURE not working on DialogFragment with style as DialogFragment.STYLE_NO_TITLE

坚强是说给别人听的谎言 提交于 2020-01-04 14:11:14
问题 When I set the style of a dialog fragment, the android is allowing to take the screen shot of dialog fragment, but after removing the style it works. Below is the code of dialog fragment's onCreate @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setStyle(DialogFragment.STYLE_NO_TITLE, android.R.style.Theme_Holo_Light); getActivity().getWindow().setFlags(WindowManager.LayoutParams.FLAG_SECURE, WindowManager.LayoutParams.FLAG_SECURE);