在fragment中有自定义布局,extend RelativeLayout
public class Footer extends RelativeLayout
如何从这个自定义对象中使用getSupportFragmentManager
?我用this.getContext()的时候会给出应用,不是 FragmentActivity
The method getSupportFragmentManager() is undefined for the type Footer (extends RelativeLayout)
this.getactivity()获得父activity
楼上回答正确,使用getActivity(),获取父的activity();