Add support for DialogFragment
See original GitHub issueIt’s almost exactly the same as regular Fragment, I’m not sure if there is an easy way to share the boilerplate code between them.
If anyone does try to add support for DialogFragments, this will keep the dialog on the screen for orientation changes.
@Override
public void onDestroyView() {
if (getDialog() != null && getRetainInstance()) {
getDialog().setDismissMessage(null);
}
ButterKnife.reset(this);
super.onDestroyView();
}```
Issue Analytics
- State:
- Created 8 years ago
- Reactions:1
- Comments:19 (14 by maintainers)
Top Results From Across the Web
Displaying dialogs with DialogFragment - Android Developers
You can create a DialogFragment and display a dialog by overriding onCreateView() , either giving it a layoutId as you would with a...
Read more >Using DialogFragment | CodePath Android Cliffnotes
DialogFragment is a specialized Fragment used when you want to display an overlay modal window within an activity that floats on top of...
Read more >Android DialogFragment - DigitalOcean
DialogFragment is a utility class which extends the Fragment class. It is a part of the v4 support library and is used to...
Read more >DialogFragment in Android - GeeksforGeeks
Dialogs are a way to show more concise information or accessibility options without creating a new activity for users.
Read more >How to use DialogFragment in Android? - Medium
extends android.app.DialogFragment { private Context mContext; · View view = inflater.inflate(R.layout.dialog_fragment, container, false); no = ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’m not sure if it is a good idea to even add this to mosby. It’s yet another thing to maintain and I can’t imagine how busy someone like @sockeqwe must be anyways. The suggested solution of adding the delegate worked with no problems. If anyone stumbles upon this and wants to copy paste an implementation for MVI check out this gist.
Thank you very much!
If you use traditional Fragment lifecycle callbacks and setup your Dialog’s view in
Fragment.onCreateView()
I would expect that simply adding the delegate like I did here works.