Android 未解析布局和资源

Android 未解析布局和资源,android,layout,Android,Layout,我完全搞不懂为什么我的布局没有得到解决。它们在那里,拼写正确,并且R.java存在并且没有抛出明显的错误 import android.R; import android.app.Activity; import android.content.Intent; import android.os.Bundle; import android.view.View; import android.widget.ImageButton; pu

我完全搞不懂为什么我的布局没有得到解决。它们在那里,拼写正确,并且R.java存在并且没有抛出明显的错误

    import android.R;
    import android.app.Activity;
    import android.content.Intent;
    import android.os.Bundle;
    import android.view.View;
    import android.widget.ImageButton;


    public class myApp extends Activity {
ImageButton b;


/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);

    b = (ImageButton)findViewById(R.id.oraclebutton);
    b.setOnClickListener(new View.OnClickListener() {
        public void onClick(View v) {
            Intent myIntent = new Intent(myApp.this, TestIntro.class);
            myApp.this.startActivity(myIntent);
        } 
    });
}
}

尝试删除对android.R的引用(只需删除“import android.R;”行)


它可能试图在那里搜索您的资源文件。

如果您使用eclipse,请尝试转到Project->Clean并清理您的项目,以便它可以重建并强制重新生成
R
类。代码示例在没有看到参考资料的情况下有点毫无意义。啊,是的。就这样!非常感谢!它不会让我在5分钟内接受答案,但我会把这个留到以后再接受