简体   繁体   English

Android R参数指的是另一个未知的R.

[英]Android R parameter refers to another unknown R

I have few .java files in my android project. 我的android项目中有几个.java文件。 I use R class several times in them. 我在里面多次使用R类。

However, in one file, I can't get it to work. 但是,在一个文件中,我无法让它工作。 When I use for example R.array.contextList (contexList array is in my generated R class) it says that contextList cannot be resolved or is not a field . 当我使用例如R.array.contextList (contexList数组在我生成的R类中)时,它表示contextList cannot be resolved or is not a field When I press ctrl+space it suggests me arrays like emailAdressTypes or postalAddressTypes ... I have never seen those arrays. 当我按下ctrl+space它会建议像emailAdressTypespostalAddressTypes这样的数组...我从未见过这些数组。 What's happening? 发生了什么? Thanks 谢谢

PS: I have cleaned my project several times and fixed errors in project several times. PS:我已多次清理我的项目并多次修复项目中的错误。

See the imports.. if it has something like 看看进口..如果它有类似的东西

android.R; android.R;

remove it and import your project's R.java 删除它并导入项目的R.java

The documentation of android.R , this will explain where those things came from. android.R的文档 ,这将解释这些东西来自何处。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM