星空网 > 软件开发 > 操作系统

.replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is 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

.replace(R.id.container, new User()).commit();/The method replace(int, Fragment) in the type FragmentTransaction is not appimages/loading.gif' data-original="http://images2015.cnblogs.com/blog/782772/201605/782772-20160524100007475-906697806.jpg" />

都导入 android.app Fragment;

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

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




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

关键词:

*特别声明:以上内容来自于网络收集,著作权属原作者所有,如有侵权,请联系我们: admin#shaoqun.com (#换成@)。

中国寄东西到马来西亚:https://www.goluckyvip.com/tag/90858.html
深圳发货到马来西亚:https://www.goluckyvip.com/tag/90859.html
中国马来西亚货运:https://www.goluckyvip.com/tag/90860.html
中国货运马来西亚:https://www.goluckyvip.com/tag/90861.html
中国到马来西亚的快递:https://www.goluckyvip.com/tag/90862.html
马来西亚至中国物流:https://www.goluckyvip.com/tag/90863.html
去日本入住酒店,东西随意用却有一个特殊“要:https://www.vstour.cn/a/411241.html
中国有哪些著名的酒店品牌。:https://www.vstour.cn/a/411242.html
相关文章
我的浏览记录
最新相关资讯
海外公司注册 | 跨境电商服务平台 | 深圳旅行社 | 东南亚物流