android - issues with file ...resource not found...cannot be resolved to a varaible

Whenever I create a project, I am having issues with my .java file whenever I reference a textview via get these errors cannot be resolved to a variable...

package COG__R_JAVA__12_11_2011;

import android.os.Bundle;

public class COG__R_JAVA__12_11_2011Activity extends Activity {
    /** Called when the activity is first created. */
    public void onCreate(Bundle savedInstanceState) {

r.layout.main >>>>cannot convert to a varailbe.....
LVL 10
Who is Participating?
589158Connect With a Mentor Commented:
I only know this message, when there is no main.xml-file in the layout-directory or the source code is referencing to an object in these layout-files which is not (yet) existing.
Error when no main-layout is existingUsually in my android installation when I choose "File"=>"New..."=>"Other..."=>"Android"=>"Android Project" a layout file called main.xml is created automatically. You should verify that and if it does not exist then you can create one by rightclicking the layout directory and choose "New..."=>"Other..."=>"Android"=>"Android XML File". If it does exist and the error persists then there is something else wrong with your installation. Maybe try to reinstall the android SDK.
GlobaLevelProgrammerAuthor Commented:
wow got that hard is it to redirect to a new page(activity)..every link I look for more than one line of code...
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.