不能得到解决或不是一个领域的错误的Andr​​oid [英] Cannot be resolved or is not a field error android

查看:68
本文介绍了不能得到解决或不是一个领域的错误的Andr​​oid的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经检查了R.java文件中存在的ID它仍然会显示错误
这里是R.java code

I have checked the id exists in the R.java file still it shows error here is R.java code

public static final class drawable {
        public static final int background=0x7f020000;
        public static final int empty=0x7f020001;
    }

在这里我得到误差

and here i am getting error

empty=BitmapFactory.decodeResource(getResources(), R.drawable.empty);//0x7f020001);

如果我直接从R.java文件中使用的值,那么它不显示任何错误

if i use the value directly from R.java file then it doesn't show any error

我已经试过项目 - >清理和修复项目属性并重新启动Eclipse还没有一次成功有人帮我找出这个

i have tried Project->Clean and fix Project properties and restarted eclipse also none of them worked somebody help me figure out this

感谢..

推荐答案

我想,也许是进口的问题。尝试检查你的类​​的进口。有时从Eclipse的Andr​​oid包导入R类和使用你的停止。
进口删除像进口android.R

I think that maybe is a problem of the imports. Try to check the imports of your class. Sometimes Eclipse imports the R class from the android package and stops using yours. Remove imports like import android.R

这篇关于不能得到解决或不是一个领域的错误的Andr​​oid的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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