在Android应用程序是什么&QUOT的作用; R.java"? [英] In Android applications what is the role of "R.java"?

查看:178
本文介绍了在Android应用程序是什么&QUOT的作用; R.java"?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Android应用程序有一个名为R.java自动生成的文件。请说明其用途。

Android applications have an automatically generated file called "R.java". Please explain its purpose.

例如。

  • 什么是包含在其中?
  • 什么产生的呢?

复制:的后面是什么R上的概念的.java?

推荐答案

每个应用程序的资源,如字符串,drawbles,布局和样式。相反,硬编码这些资源到应用程序中,一种外化他们,并指给他们的ID。该R.java文件包含了所有这些资源标识,无论是分配由程序员或由SDK生成。

Every application uses resources such as strings, drawbles, layouts, and styles. Instead of hard coding such resources into an application, one externalizes them and refers to them by ID. The R.java file contains all those resource IDs, whether assigned by the programmer or generated by the sdk.

这篇关于在Android应用程序是什么&QUOT的作用; R.java"?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆