I want to create a @EBean
class with all functions related to show and hide ProgressDialog
and DialogFragment
. Ex: I need to show the ErrorDialogFragment
inside a Fragment
, so getChildFragmentManager()
is needed in this below code:
ErrorDialogFragment.showDefaultDialog(getChildFragmentManager(),
"Device is disconected!");
Is there a way to call getChildFragmentManager()
inside the @EBean
class?
However make sure you only inject this bean to a
FragmentActivity
, because otherwise theActivity
itself will not be injected into the bean.Edit: You cannot inject the
FragmentManager
nor theFragment
to the bean with annotations. You have to create a setter method for that:In your
Fragment
: