当前位置:   article > 正文

Required type: android.support.v4.app.Fragment Provided: android.app.Fragment_required type: fragment provided: adbannerfragment

required type: fragment provided: adbannerfragment

在这里插入图片描述

1 android.support.v4.app.,而且必须是getSupportFragmentManager();
FragmentManager f = getFragmentManager();
f.beginTransaction().replace(R.id.home_container,fragment).commit();

/**
 * Return the FragmentManager for interacting with fragments associated
 * with this activity.
 *
 * @deprecated Use {@link android.support.v4.app.FragmentActivity#getSupportFragmentManager()}
 */
@Deprecated
public FragmentManager getFragmentManager() {
    return mFragments.getFragmentManager();
}
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

2 android.app.Fragment.,而且必须是getFragmentManager();
FragmentManager f = getFragmentManager();
f.beginTransaction().replace(R.id.home_container,fragment).commit();
/**
* Return the FragmentManager for interacting with fragments associated
* with this activity.
*
* @deprecated Use {@link android.support.v4.app.FragmentActivity#getSupportFragmentManager()}
*/
@Deprecated
public FragmentManager getFragmentManager() {
return mFragments.getFragmentManager();
}

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/不正经/article/detail/529641
推荐阅读
相关标签
  

闽ICP备14008679号