简体   繁体   中英

Android R parameter refers to another unknown R

I have few .java files in my android project. I use R class several times in them.

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 . When I press ctrl+space it suggests me arrays like emailAdressTypes or postalAddressTypes ... I have never seen those arrays. What's happening? Thanks

PS: I have cleaned my project several times and fixed errors in project several times.

See the imports.. if it has something like

android.R;

remove it and import your project's R.java

The documentation of android.R , this will explain where those things came from.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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