Carnivoris
Carnivoris

Reputation: 803

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.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);
        } 
    });
}
}

Upvotes: 2

Views: 69

Answers (1)

dymmeh
dymmeh

Reputation: 22306

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.

Upvotes: 4

Related Questions