R cannot be resolved - android error

Posted by MaurizioPz on Stack Overflow See other posts from Stack Overflow or by MaurizioPz
Published on 2009-05-19T21:02:20Z Indexed on 2010/04/21 1:03 UTC
Read the original article Hit count: 455

Filed under:
|

Hi, I just downloaded and installed the new android sdk. I wanted to create a simple application to test drive it.

the widzard creates this code:

package eu.mauriziopz.gps;

import android.app.Activity;
import android.os.Bundle;

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

but ecplise give me this error

R cannot be resolved

on this line

setContentView(R.layout.main);

can any one explain me why?

ps. I do have an xml file named main.xml under res/layout/

© Stack Overflow or respective owner

Related posts about android

Related posts about eclipse