So I've created a DialogFragment that is shown as a dialog via this technique
Now that it's launched and upon a user interaction within this popup I want to slide in another fragment to this dialog. I'm trying to do this via FragmentTransaction.add() where I give it the id of one of the containers in this layout. At this point I get:
java.lang.IllegalArgumentException: No view found for id 0x7f09013f for fragment <fragmentClassThatIWasPushingIn>
As a quick test, I tried to push it onto a container id not in the dialog but within the main backing activity and that worked just fine.
Is there something about DialogFragments and its container ids that does not allow for FragmentTransactions?
As a stopgap I've told my transaction to hide the current DialogFragment and show this new fragment, but the animation/display is a little jarring so I'd really like to sort this issue out.
Thanks
When a DialogFragment
is shown as a Dialog
it is not actually a real Fragment
in a container view. It is a container-less Fragment
which is basically a wrapper of a Dialog
.
So no, you can not show a Fragment
inside a FragmentDialog
. If you really want to do this I think the best way would to create a new Activity
styled as a Dialog
which you can then add Fragments
too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With