R 1不能被解析 [英] R cannot be resolved
问题描述
package com.ustr.eMIRnew;
import java.util.ArrayList;
import java.util.HashMap;
import android.R;
import android.app.Activity;
import android.os.Bundle;
import android.widget.ListView;
import android.widget.SimpleAdapter;
public class eMIRnew extends Activity {
/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
}
}`
这是我的code。但它显示研究解决不了的错误
。结果
我试过很多方法,如清洁及建造,封闭和开放的项目,改变了进口android.R
到进口your.package。 name.R
等,但没有任何帮助。任何人可以帮助我,好吗?
This is my code. But it is showing the error R cannot be resolved
.
I have tried many methods like clean-and-build, closed-and-open the project, changed import android.R
to import your.package.name.R
etc. But nothing helped. Can anybody help me, please?
推荐答案
您正在导入android.R包,这是由Android提供的默认之一。
如果您要访问自己的布局,资产的字符串。 。 。然后
删除进口android.R声明。
You are Importing android.R package, which is default one provided by Android.
If you want to access your own Layout, assets, String. . . then
Remove the import android.R statement.
没有必要在建造的。导入您Package.R,默认情况下,会生成R档
No need to import your Package.R, By default, R file is generated during built.
这篇关于R 1不能被解析的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!