*)if you run the android app, and it displays an exception, then you find the resource returned by findviewbyid is null,
most likely you are using the old style "id" in you xml layout file, change it to "android.id" will fix your problem.
*)if there is a compile error related to R.id.**, please build your project manually to refresh the R file.
if you perform a clean and build, eclipse may indicate you to fix project build path error, yet you just need to remove the R file and recreate it by building the project once again.
本文介绍了当Android应用出现布局资源为空的异常时的解决办法。一种情况是因为使用了旧版的ID引用方式,需要将id更改为android.id;另一种情况则是与R.id有关的编译错误,此时应手动清理并重建项目来刷新R文件。
6056

被折叠的 条评论
为什么被折叠?



