您的位置:首页 > 其它

Unable to start activity ComponentInfo: Resource ID is not valid

2013-10-26 22:14 597 查看
今天写代码时出现了无法启动Activity的情况,

先报的Resource ID is not valid的错误,原因是我在setcontentview(R.layout.xxx)是写成了setcontenview(R.id.xxx).刚好,这个布局文件我给了一个同名的ID。

home_content_frame.xml文件

"1.0" encoding="utf-8"?>

“http://schemas.android.com/apk/res/android”

android:id=<span class="str">"@+id/home_content_frame"</span>
android:layout_width=<span class="str">"match_parent"</span>
android:layout_height=<span class="str">"match_parent"</span> >


我想在代码中使用fragment来代替这个布局

getSupportFragmentManager()
.beginTransaction()
.replace(R.id.home_content_frame,mContent)
.commit();
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: 
相关文章推荐