Layouts and resources not being resolved
I'm completely confused as to why my layouts aren't being resolved. They're there, spelled correctly, and R.java is present and not throwing an obvious error.
import android.R;
import android.app.Activity;
import android.content.I开发者_开发知识库ntent;
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);
}
});
}
}
Try removing the reference you have to android.R (just delete the line "import android.R;")
It's likely trying to search in there for your resource files.
精彩评论