.replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is not app_移动开发_编程开发_程序员俱乐部

中国优秀的程序员网站程序员频道CXYCLUB技术地图
热搜:
更多>>
 
您所在的位置: 程序员俱乐部 > 编程开发 > 移动开发 > .replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is not app

.replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is not app

 2016/5/25 5:34:31  小波Linux  程序员俱乐部  我要评论(0)
  • 摘要:提示错误:Themethodreplace(int,Fragment)inthetypeFragmentTransactionisnotapplicableforthearguments(int,MyFragment)getFragmentManager().beginTransaction().replace(R.id.container,newUser()).commit();FragmentActivity导入的库不一样,导入一样的即可。看图:http://www.cnblogs
  • 标签:not APP

提示错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, MyFragment)

 getFragmentManager().beginTransaction()
                 .replace(R.id.container, new User()).commit();

Fragment Activity导入的库不一样,导入一样的即可。

看图:http://www.cnblogs.com/xiaobo-Linux qq463431476

都导入 android.app Fragment;

V4的是兼容低版本的,目前4.4---5.0以上不需要;

http://www.cnblogs.com/xiaobo-Linux

发表评论
用户名: 匿名