android编程常见问题- Resource ID #0x7f070001 type #0x12 is not valid

问题说明:

AndroidRuntime(1705): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.activitytest/com.example.activitytest.SecondActivity}: android.content.res.Resources$NotFoundException: Resource ID #0x7f070001 type #0x12 is not valid

 

解决办法:

根据Resource ID #0x7f070001 type #0x12 is not valid 提示,去R.java 文件中检查是否定义该对象,

 

如果已经定义,则检查com.example.activitytest.SecondActivity类

  

 

发现语句写错了,改为:setContentView(R.layout.second_layout);解决问题

posted @ 2014-09-25 09:05  职场人的思考  阅读(6050)  评论(0编辑  收藏  举报