开发者

unable to edit R.java Android using Eclipse

开发者 https://www.devze.com 2023-01-26 09:52 出处:网络
I am new to Android. Well the problem I am facing is that I have two layouts. One is main.xml and another that I made was relative_layout.xml.

I am new to Android. Well the problem I am facing is that I have two layouts. One is main.xml and another that I made was relative_layout.xml.

I did not give it an @+id/ to this layout so the default id was relative_layout01.xml but when I gave this an id the old one still remain in my R.ja开发者_运维百科va and when I edit R.java it again generated the old version of file.

I want to delete relative_layout01.xml reference as it does not exists as I have given a name to my layout.

Attaching an image for reference.

unable to edit R.java Android using Eclipse


R.java should be refreshed automatically.

Maybe you still have some references to it in your code (setContentView(R.relative...) or you still have it as an activity in AndroidManifest.xml?

Sorry for the noobish answer. Just my 2 cents..


Delete import android.R, and R.java completely, rebuild and it would be fine

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号