What you have come across is not really an issue at all.
You should make NavigationFragment
extend DialogFragment
, and then only call setShowsDialog(true)
in onCreate
for those you want to show as a Dialog. From the helpDoc,
setShowsDialog
Controls whether this fragment should be shown in a dialog. If not set, no Dialog will be created in onActivityCreated(Bundle), and the fragment's view hierarchy will thus not be added to it. This allows you to instead use it as a normal fragment (embedded inside of its activity).
This is normally set for you based on whether the fragment is associated with a container view ID passed to FragmentTransaction.add(int, Fragment). If the fragment was added with a container, setShowsDialog will be initialized to false; otherwise, it will be true.
See Android fragment show as dialogfragment or usual fragment, or better yet, the official documentation (http://developer.android.com/reference/android/app/DialogFragment.html#DialogOrEmbed) for a more detailed explanation on how to utilize this function.