可以肯定的一点,那些静态变量的int值确实是代表内存地址。
个人认为:由于R.java是根据main.xml自动创建的,所以,那些组件应该是在创建main.xml时被放到那些内在地址中的。

解决方案 »

  1.   

    不应该是内在地址吧。因为它并不是直接得到结果,也跟JAVA一样,生成class文件,再统一生成一个文件(忘记叫啥名了)。也许其中有一些运算,再得到内存地址吧。个人想法。
      

  2.   

    会不会是HashMap的key值
    大家认为呢,用HashMap存资源信息
      

  3.   

    怎么可能是内存地址!!!! 程序运行前你还能知道资源文件所在的内存地址。荒谬!!!
    官方解释是:
    A project's R.java file is an index into all the resources defined in the file. 
    You use this class in your source code as a sort of short-hand way to refer to 
    resources you've included in your project. This is particularly powerful with the 
    code-completion features of IDEs like Eclipse because it lets you quickly and 
    interactively locate the specific reference you're looking for.The important thing to notice for now is the inner class named "layout", and 
    its member field "main". The Eclipse plugin noticed that you added a new XML 
    layout file and then regenerated this R.java file. As you add other resources to 
    your projects you'll see R.java change to keep up.
      

  4.   

    是对project中所有资源(如,图像,控件)的int索引,在project中就可以通过R.XX的方式进行引用了。
      

  5.   

    可以肯定这个不是内存地址。请参考一下《HelloAndroid》一书:
    The hex numbers are just integers that the Android resource manager
    uses to load the real data, the strings, and the other assets that are
    compiled into your package. You don’t need to worry about their values.
    Just keep in mind that they are handles that refer to the data, not the
    objects that contain the data. Those objects won’t be inflated until they
    are needed. Note that almost every Android program, including the base
    Android framework itself, has an R class.
    翻译一下(翻译的不好,别喷我:) ):
    这个16进制的数字仅仅是个整数,Android的资源管理器用它来加载编译到你包里的实际的数据、字符串、其他assets,你不用担心他们的值,只要记住他们是涉及到数据的句柄,而不是包含数据的对象。这些对象知道被使用时才会被放到填充(我自己不太理解这句话,可能是:知道用到时才被加载到内存中)。注意:几乎每个Android程序,包括最基本的Android框架也有一个R类
      

  6.   

    刚整了几个android的小程序,还没有好好学习呢,明天看一下大家说的r.jave中内容了,咱也好好学习一下