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

  • SEARCH
  • Home
  • 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 8178411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T23:45:37+00:00 2026-06-06T23:45:37+00:00

Note: When parsing XML resources, Android ignores XML attributes that aren’t supported by the

  • 0

Note: When parsing XML resources, Android ignores XML attributes that
aren’t supported by the current device. So you can safely use XML
attributes that are only supported by newer versions without worrying
about older versions breaking when they encounter that code. For
example, if you set the targetSdkVersion=”11″, your app includes the
ActionBar by default on Android 3.0 and higher. To then add menu items
to the action bar, you need to set android:showAsAction=”ifRoom” in
your menu resource XML. It’s safe to do this in a cross-version XML
file, because the older versions of Android simply ignore the
showAsAction attribute (that is, you do not need a separate version in
res/menu-v11/).

Source: http://developer.android.com/training/basics/supporting-devices/platforms.html

^ Despite this claim eclipse is refusing to compile an unaltered version of fragment basics from the same site here.

The error message given is:

String types not allowed (at ‘layout_width’ with value
‘match_parent’).

Is there anyway I can suppress this error within XML, like some kind of silent tag that states they only apply to a specific API level? Ideally I want the project to work in Eclipse and also maintain 1.6 backwards compatibility.

NOTE: All other errors pertain to R not being generated making this the only first generation error.

The manifest file does contain the line

<uses-sdk android:minSdkVersion="4" android:targetSdkVersion="15" />
  • 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-06T23:45:38+00:00Added an answer on June 6, 2026 at 11:45 pm

    You can compile in the newer API’s and the application will still work in the old API, thereby getting rid of these errors, as long as you don’t use any of the unsupported features in the .java files without first providing relevant checks. I thought I had to compile against the lowest API not the highest but have tested using a 1.6 AVD to run a project compiled using 4.0 and it worked flawlessly.

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

Sidebar

Related Questions

I have been parsing xml content using the xmlreader and cannot use the xml
I am parsing a XML file with a format of: **NOTE: This is a
I am parsing data from a website via xml that always changes so I
I have a xml file, i can do the parsing using the NSXML parser.
After parsing HTML or XML file, we can get the DOM tree. After parsing
Note, this is not a duplicate of .prop() vs .attr() ; that question refers
Note: I am not asking how to use Google Code's SVN repo as a
NOTE: This is a followup to my question here. I have a program that
I am parsing xml files in Perl and everything seems to work great with
Hey I am having issues parsing XML file, Theres seems an unrecognised symbol after

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.