开发者

Better documentation for android.R.*?

I'm obviously pretty new to Android. Does better documentation exist for the set of android.R.* classes somewhere? The API reference is pretty bare bones, many times only containing the resource literal IDs and not explaining how/where they are us开发者_Go百科ed. Similarly, it would be nice if additional information (or pictorial examples) existed for the various platform defined layouts and styles.

Or am approaching this the wrong way? Perhaps there's a better method to determine their usage than going straight to the documentation. I'm finding this portion (I'm not even sure what to call it) to be the most confusing aspect of Android programming by far and am open to any suggestions that will better my understanding.

Thanks!


Source code would be the best documentation. At least, it's very helpful when you need to understand how the function does what is briefly described in documentation.


I think you are confused about what R is.. The R file is autogenerated during the compilation process based on the resources you have in your res folders.

So, if you add a strings file: res/values/strings.xml with contents:

<resources>
    <string name="string_name">text_string</string>
</resources>

R will now contain an entry for R.string.string_name.

For a details on all of the different types of resources, see resource types.

Edit: As to "platform defined layouts", have you looked at the developer docs on it? See common layout objects. Also each layout type has a tutorial on it, search for "Hello --layout type--"

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜