Closed sajorahasan closed 7 years ago
Are you trying to use Fragments inside AAH_FabulousFragment
?
Below code when called from fragment works fine:
FilterDialogFragment dialogFrag = FilterDialogFragment.newInstance();
dialogFrag.setParentFab(fab);
dialogFrag.show(getActivity().getSupportFragmentManager(), dialogFrag.getTag());
No i have fragment in which i have floating action button and on the onClickEvent I'm trying to call FilterDialogFragment
` FloatingActionButton fab = (FloatingActionButton) view.findViewById(R.id.filterbtn); fab.setOnClickListener(v -> { FilterFragment dialogFrag = FilterFragment.newInstance(); dialogFrag.setParentFab(fab);
dialogFrag.show(getActivity().getSupportFragmentManager(), dialogFrag.getTag());
});`
Seems like an issue with the Activity. Does your Activity extend AppCompatActivity
? If not, try using getFragmentManager()
or getChildFragmentManager()
. Also check this link https://stackoverflow.com/questions/13443811/cannot-call-getsupportfragmentmanager-from-activity
I added a Fragment example in the sample app.
hi, thanks for the quick reply and help. I was using android.app.Fragment; that's why i was unable to call getActivity().getSupportFragmentManager()
Hi, Thanks for this awesome looking library but can you please help me, I'm trying to implement this library in fragment and getSupportFragmentManager is not working even getActivity().getSupportFragmentManager()