I have this app with a common activity and several different fragments replaced into the same layout ID: R.id.content
Some of the fragments are normal support.v4.Fragment and some are from v4.DialogFragment
On tablets, DialogFragments are shown as Dialogs and on phones they're normally included in the R.id.content
So usually if I want to find out which fragment is current, it's easy to call
getSupportFragmentManager().findFragmentById(R.id.content);
but the DialogFragments issued are Dialogs are not on the R.id.content
, AFAIK they're not even in the same Window.
So the question is: is there any "framework level" way to locate the dialog fragments? I mean, is there a way to do it without having to manually keeping reference of Fragments (or their tags) ?