Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8735705
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T10:07:50+00:00 2026-06-13T10:07:50+00:00

Eclipse + Android plug-in. Modify sample code that runs correctly. When creating a new

  • 0

Eclipse + Android plug-in.

Modify sample code that runs correctly.

When creating a new object in the existing code, error:

newObj cannot be resolved or is not a field

The first “suggested fix” adds it to the R.java file. (I also see that the first original object is listed there with a value.)

However, after I save the file, the IDE displays:

R.java was modified manually! Reverting to generated version!

How do I add this new object to the code? Should I just fore a new R.java file?

Any help in the right direction is greatly appreciated?

Please see code here.

Thank You.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T10:07:52+00:00Added an answer on June 13, 2026 at 10:07 am

    You should never modify R.java manually. This is generated from the xml files in the sub-folders of res. You should look in the example that you’re following where the declaration of newObj exists. The error you’re getting that newObj cannot be resolved probably means it has not been declared. Post a link to the sample code you’re working with and it will be much clearer how to fix this.

    EDIT

    After looking at the code sample linked in the comments, you’re missing the XYPlot object being delcared in your res/layout/main_activity.xml file. To be able to use R.id.newObj to refer to a view in your activity layout, it must exist as a control in the layout. And the casting implies that this control should be of type XYPlot (fully qualified with namespace when used in xml layouts).

    EDIT 2

    In order to use the findViewById method to resolve a View object, it needs to be in the layout’s xml. If you want to insert it into your layout in code, you need some other way of instantiating the object.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

a million error per day using eclipse with the Android plug-in i tried everything
i am new to android development. I use the eclipse with android plug-in and
I've been using an eclipse plugin that allows me to view android source code
I just finished setting up my Eclipse with the Android plug-in. (i.e https://dl-ssl.google.com/android/eclipse/ )
I've been developing an Android app using Eclipse and the Android plug-in for Eclipse
I'm new to Java/Eclipse/Android, so this is probably an easy (if not stupid) question:
For some reason my eclipse/android development environment has stopped creating the r.java files and
I'm using the Android plug-in in my Eclipse environment to design layouts. I have
I'm trying to install the Android plug-in for Eclipse (32 bit Windows 7 -
For quite a while my Eclipse environment with the Android plug-in was running smoothly.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.