您的位置:首页 > 移动开发

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

2016-05-24 10:02 453 查看
提示错误: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
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: