I delete the R.java of my application, and build my application to apk successfully.It means that the R.java doesn't work. why?
That's because it gets re-created as part of the build process, based on what's in your strings.xml and such.
R.java is dynamically created, either by the IDE when it detects changes to resources, or by the ant build script before Java compilation. aapt does the real work.
It's useful to have R.java available when editing in an IDE so that the auto-complete functionality finds R.whatever, but it isn't strictly necessary. Please read here for details on the build process.
Hope this helps,
Phil Lello
精彩评论