Cannot resolve method 'getSupportFragmentManager ( )' inside Fragment

后端 未结 14 730
别跟我提以往
别跟我提以往 2020-12-01 05:16

I found the message Cannot resolve method \'getSupportFragmentManager ( )\' I want to fragment as activity. because I want to use Maps on the tabs swipe.

pub         


        
14条回答
  •  遥遥无期
    2020-12-01 05:38

    For me I made sure to import v4 like this:

    import android.support.v4.app.DialogFragment;
    

    Then used:

    getActivity().getFragmentManager()
    

提交回复
热议问题