有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

安卓 java文件中的这些数字是什么?

所以我一直在尝试制作一些应用程序,并在寻找一些灵感。我在github上浏览一个应用程序,查看代码。有数字和属性。我不明白这些数字是什么。有人能解释一下这些安卓文件中的数字吗

public static final class attr {
    public static final int actionBarDivider = 2130772069;
    public static final int actionBarItemBackground = 2130772070;
    public static final int actionBarPopupTheme = 2130772063;
    public static final int actionBarSize = 2130772068;
    public static final int actionBarSplitStyle = 2130772065;
    public static final int actionBarStyle = 2130772064;
    public static final int actionBarTabBarStyle = 2130772059;
    public static final int actionBarTabStyle = 2130772058;
    public static final int actionBarTabTextStyle = 2130772060;
    public static final int actionBarTheme = 2130772066;
    public static final int actionBarWidgetTheme = 2130772067;
    public static final int actionButtonStyle = 2130772093;
    public static final int actionDropDownStyle = 2130772088;
    public static final int actionLayout = 2130772023;
    public static final int actionMenuTextAppearance = 2130772071;
    public static final int actionMenuTextColor = 2130772072;
    public static final int actionModeBackground = 2130772075;
    public static final int actionModeCloseButtonStyle = 2130772074;
    public static final int actionModeCloseDrawable = 2130772077;
    public static final int actionModeCopyDrawable = 2130772079;
    public static final int actionModeCutDrawable = 2130772078;
    public static final int actionModeFindDrawable = 2130772083;

等号后面的数字是什么

它们已经在同一个应用程序的另一个安卓 java文件中使用,如下图所示

this.et = (EditText) findViewById(PT1293.id.etRoll);
this.Scloth.setAdapter(new ArrayAdapter(this, 17367049, this.branch));

共 (1) 个答案

  1. # 1 楼答案

    这些数字是在项目的R类中生成的

    Once you externalize your app resources, you can access them using resource IDs that are generated in your project's R class. This document shows you how to group your resources in your Android project and provide alternative resources for specific device configurations, and then access them from your app code or other XML files.

    例如,如果string1的id为4445,则为R.string。string1是4445

    但通常(总是)为了访问资源,我们不将资源标识符硬编码为int,如下所示。相反,它们是生成的,我们使用R.string访问资源。例如string1

    正如@commonware所说,它看起来像是Apk的逆向工程

    有关更多信息,请参见here