question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Add support for DialogFragment

See original GitHub issue

It’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:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:19 (14 by maintainers)

github_iconTop GitHub Comments

1reaction
ltrojanowskicommented, Mar 27, 2018

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.

1reaction
sockeqwecommented, Jul 12, 2017

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found