I have the following code in an Activity that starts a dialog for a layout that contains a fragment.
...
case R.id.pick_resource:
dialog = new Dialo
Does the fragment in your layout have an android:id attribute?
I suspect this is because the fragment is instantiated each time your layout is inflated, the first time the ID isn't being used, but the second time the FragmentManager still thinks your Fragment is alive, so the ID is considered a duplicate.
Try removing the android:id attribute from your fragment if it exists, or add a placeholder layout such as a framelayout and use a fragmenttransaction to dynamically add the fragment each time your dialog is created.