user2737537
user2737537

Reputation: 1

Android Emulator and Eclipse

I am fairly new to programming and Eclipse.
I've created a hello world app to get used to Eclipse. My app has a background (that I created using paint), a button, and a few texts (that say hello world), but when I start up the android emulator(which is the Nexus S) it starts my app, but instead of seeing the background and hello world text and button, I just see a blank white screen with only a title on the top which I made that says My First App.
Could someone tell me what the problem is and how to fix it?

Upvotes: 0

Views: 137

Answers (1)

Ahmed Ekri
Ahmed Ekri

Reputation: 4651

I'm pretty sure you forgot to either save your xml layout or your didn't assign it to the activity.

after the onCreate add this

setContentView(R.layout.activity_main*your xml layout name*);

it should look like this:

@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_main);
}

Upvotes: 1

Related Questions