android - 来自 int 的资源

标签 android textview

当我有消息来源时:

TextView localTV = (TextView)findViewById(2312345);

有没有办法让编译器将其转换为具有真实名称的资源,例如:

TextView localTV = (TextView)findViewById(R.id.mytext);

最佳答案

When I have a source with this

拥有该代码的最可能原因是该代码是从 APK 反编译而来的。

is there a way to kindly ask the compiler to transform it into the resource with its real name

没有,原因很简单,可能没有与该编号对应的资源。一旦将这个反编译的应用程序加载到 IDE 中,所有资源都会被分配编号,这些编号可能与反编译代码中的硬编码值匹配,也可能不匹配。

关于android - 来自 int 的资源,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30106346/

相关文章:

java - 类(class)成员是什么意思? In-keepclassmembers Proguard

java - 打印 Unicode 字符 Android TextView

android - 来自 Html 粗体标记的 Textview 未正确显示

android - 延迟 onPause() 方法

android - 问题 : While stationary Android GPS gives different location updates - Closed

javascript - 我可以清除移动设备上触摸的 div 的焦点吗?

android - 如何设置 android TextView 以剪切任何不适合布局的字母

android - 如何在textview中的文本末尾显示3个点

android - 如何在 Android TextView 中为数字设置从右到左的方向?

android - queryIntentActivityOptions 不工作