getsupportfragmentmanager not working in fragment Ask Question
By       29-Apr-2025    1

i'm using DialogFragment ​but the getsupportfragmentmanager  ​not working is shows me an error cannot resolve getsupportfragmentmanager  ​();


 

Solutions


Nawab

Create a private FragmentActivity Context;

and Override

@Override
public void onAttach(Activity activity) {
    Context=(FragmentActivity) activity;
    super.onAttach(activity);
}

and use as below where you needed

FragmentManager fragManager = Context.getSupportFragmentManager();

 

10042
Copyright Future Minutes © 2015- 2025 All Rights Reserved.   Terms of Service  |   Privacy Policy |  Contact US|  Pages|  Whats new?
Update on: Dec 20 2023 05:10 PM