Developing for Android in Eclipse: R.java not regenerating

前端 未结 30 3090
孤城傲影
孤城傲影 2020-11-21 07:04

I\'ve found out that my R.java is never updated, so it doesn\'t contain information about my new resources, so I decided to delete it and thought that Eclipse would generate

30条回答
  •  粉色の甜心
    2020-11-21 07:56

    I've came across this problem a few times. I found that if I didn't import the package R through my application's name, for example, if my application had the package name example.test then I found that I had to import example.test.R in order to access any of the resources.

    If this wasn't imported then the resources that where getting returned were the default resources with none of my own included.

    With that said if you find that you are only getting a list of default resources then just check to make sure that you're importing application_package_name.R and not android.R.

提交回复
热议问题