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 5948923
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T17:10:38+00:00 2026-05-22T17:10:38+00:00

I had problems with resolving R several times after I added new layout XML

  • 0

I had problems with resolving R several times after I added new layout XML files. I use Eclipse and API 8. Sometimes it goes away after I “clean” the project, or close and then reopen the project. I tried to add “import android.R” but it didn’t help. Someone said that this is because some layout XML files have errors, but the file looks right to me.

Here is an XML file, res/layout/status.xml, that I had problems with:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout
   xmlns:android="http://schemas.android.com/apk/res/android"
   android:layout_width="match_parent"
   android:layout_height="match_parent">
   <Button android:text="Button" android:id="@+id/button_tmp" android:layout_height="wrap_content" android:layout_width="wrap_content"></Button>
</LinearLayout>

and here is how I use it:

public class StatusActivity extends Activity {
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.status);
    }
}

One more thing, this XML file has a question mark in the “Package Explore” panel in Eclipse, but the main.xml has a different icon. I have only two layout XML files now.

Do I need to do something special in Eclipse to add a new layout XML file?

Thanks for your help!

Update a screenshot of icons in the “Package Explore” panel:

enter image description here

  • 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-05-22T17:10:39+00:00Added an answer on May 22, 2026 at 5:10 pm

    Finally figured it out. There is nothing wrong with the layout XML file. The problem is that the StatusActivity class is not in the top-level package, but the R class auto-generated is in the top-level package. So in Status.java, I need to import it, but in the main activity class, which is in the top-level package, I don’t. That’s why main.xml works but status.xml does not.

    As for the different icon, it indicate if this file is managed by the SCM system. Since status.xml is new, so it has a question mark.

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

Sidebar

Related Questions

I've had some problems with a Django application after I deployed it. I use
Has anyone else had any problems using google's Domain Tracking API, I am specifically
I've had problems with the dataset visualizer that comes with 2005 and 2008 blowing
I've had problems with Internet Explorer not applying the last property in a list
I've had problems with the update method in subsonic, so instead of using: a.Update()
I've never had problems with references as in Python (implicit) or PHP (explicit &).
One thing with which I have long had problems, within the CakePHP framework, is
For about a year now, I've had problems trying to send and receive email
I had some problems with my subversion server and i had to restore it
I recently had some problems with my VS 2008, and was recommended to reinstall.

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.