-1

have no experience in Java.Get this error in "R." everywhere in Main_activity.java, when make a new Android project in Eclipse

       setContentView(R.layout.activity_main);

       if (id == R.id.action_settings)

Help appreciated.Thanks

2
  • 2
    What error? All you have here are two lines of incomplete code. Commented Dec 2, 2014 at 1:20
  • Possible dupe of stackoverflow.com/questions/4932282/… Commented Dec 2, 2014 at 1:21

2 Answers 2

1

Check if the id action_setting is in your activity_main xml file. If it is but the error is still there. Go to Projects, try cleaning.

Sign up to request clarification or add additional context in comments.

Comments

0

Normally this error happens when you have errors in your xml files (layouts/string/styles etc). Please make sure all the xml files are correct and build the project again.

P.S IMO Main_activity.java this name is not according to the standard Java naming conventions.As you are still a newbie to Java/Android I think you better start studying about those basic concepts. That will make your life more easier

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.