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

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

package COG__R_JAVA__12_11_2011;



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

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


r.layout.main >>>>cannot convert to a varailbe.....
LVL 10
GlobaLevelProgrammerAsked:
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.
0
 
GlobaLevelProgrammerAuthor Commented:
wow got that fixed...how hard is it to redirect to a new page(activity)..every link I look for it..is more than one line of code...
0
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.