.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

都导入 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的更多相关文章
- 错误:The method replace(int, Fragment) in the type FragmentTransaction is not applicable for the arguments (int, MyFragment)
Fragment newfragment =new MyFragment();fragmentTransaction.replace(R.layout.activity_main,newfragmen ...
- The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the arguments (int, SettingFragment, String)
The method replace(int, Fragment, String) in the type FragmentTransaction is not applicable for the ...
- Andriod学习笔记2:“Your content must have a ListView whose id attribute is 'android.R.id.list'”问题的解决办法
问题描述 activity_main.xml代码如下: <?xml version="1.0" encoding="utf-8"?> <Lin ...
- Android Your content must have a ListView whose id attribute is 'android.R.id.list'错误的解决办法
在Android开发中,ListView有着很重要的地位,使用的场合也非常的多 错误提示:Your content must have a ListView whose id attribute is ...
- 初学时遇到的小问题Your content must have a ListView whose id attribute is 'android.R.id.list'
问题提出 错误提示:Your content must have a ListView whose id attribute is 'android.R.id.list' 关于解决Your conte ...
- findViewById(R.id.btn_first) 给写成 R.layout.
窗体内放了个按钮, findViewById(R.id.btn_first) 给写成 R.layout. 在java 里边引用结果就是找不到那个id 找了半天找不到原因, 奔着网上常见R找不到的问题, ...
- Library Project里面使用Case语句判断R.id值报错。case expressions must be constant expressions
原文地址:http://blog.csdn.net/wchinaw/article/details/7325641 在一般的Android项目里R里面的资源声明看起来是这样的: public stat ...
- Android java.lang.NoSuchFieldError: No static field xxx of type I in class Lcom/XX/R$id; or its superclasses
项目开发快到尾声,突然发现之前一个模块莫名其妙的奔溃了,我的内心也是奔溃的.以前一直都是好好的,也没去动过它,为啥会出现这样的问题呢? 下面我会根据自己的理解来看待问题 android是怎么根据id查 ...
- Android 找不到所标识的资源 java.lang.NoSuchFieldError: No static field XXX of type I in class Lcom/XX/R$id
报错: java.lang.NoSuchFieldError: No static field XXX of type I in class Lcom/XXX/R$id; or its supercl ...
随机推荐
- Django 1.10 中文文档------3.2.1 模型Models
3.2.1 models模型 通常一个模型映射一张单独的数据表. 基本概念: 每个model都是django.db.models.Model的子类 model的每个属性代表数据表的某一列 Django ...
- PHP intval()
定义和用法 获取变量的整数值,允许以使用特定的进制返回.默认10进制 注:如果参数为整数,则不做任何处理. 语法 intval (var, base) 参数 描述 var 必须.可以是任何标量类型. ...
- python征程1.2(初识python)
1.操作符. 和其他绝大多数语言一样,Python的算术操作符以你熟悉的方式工作. “+,—,×,/,//,%,**,” 注意:python有两种除法操作符(1)单斜杠用以传统除法,(2)双斜杠用以浮 ...
- MVC中实现Area几种方法
概述 ASP.NET MVC中,是依靠某些文件夹以及类的固定命名规则去组织model实体层,views视图层和控制层的.如果是大规模的应用程序,经常会由不同功能的模块组成,而每个功能模块 ...
- CSS3 莲花盛开动画
点击这里查看效果:http://keleyi.com/a/bjad/32gxxsaw.htm 或者:http://keleyi.com/keleyi/phtml/css3/10a.htm 效果图: 代 ...
- js 循环li添加点击事件 (闭包的应用)
var aLi = document.querySelectorAll('.article-tab li'); for (var i = 0; i <= aLi.length; i++) { ...
- TinyMCE添加图片 路径自动处理成相对路径
默认情况下会自动转换你的图片路径如: 转换: /path/name.jpg 为 ../path/name.jpg 带有域名的路径也会被转换为相对路径. 需要修改一个设置convert_urls,官方文 ...
- 手机浏览器不支持 IDBObjectStore.getAll
最近在学习IndexDB,使用了IDBObjectStore.getAll,发现手机上不支持. 后面,查阅了mdn:  的确是不支持,且可以看到这个函数现在兼容性很差. 解决方法: 1.使用 IDB ...
- Quartz2D简介
Quartz 2D是一个二维绘图引擎,同时支持iOS和Mac系统 Quartz 2D能完成的工作:
- ArcGIS API for Silverlight 使用GeometryService求解线与线的交点
///画线 void btn_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { Button btn = sender as B ...