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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:07:35+00:00 2026-06-04T11:07:35+00:00

How can I use ?android:attr/ xml elements with API 7? For API 15 it

  • 0

How can I use ?android:attr/ xml elements with API 7?
For API 15 it works as expected, but the older ones throw errors.

<TextView
    ...
        android:paddingLeft="?android:attr/listPreferredItemPaddingLeft"
        android:paddingRight="?android:attr/listPreferredItemPaddingRight"
        android:minHeight="?android:attr/l  istPreferredItemHeightSmall" />
  • 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-04T11:07:36+00:00Added an answer on June 4, 2026 at 11:07 am

    If you are targeting a minimum API level of 7, but depending on support from API 15 that’s not going to work in many cases.

    Now having said that there are some attributes that translate fine between a lower and higher API, but many depend on corresponding API support so you have to test for that.

    My approach has been to pick my lowest API, but build with the higher API and include the support package for the lower API that makes some higher level support available (fragments for instance)

    To see if you are going to encounter any issues you would set the minimum API to 7 in your manifest, and add API 15 in your projects android properties.

    Then build and deploy to an emulator using API 7, if it works great, if not you will need to find a different way to do what you are trying to accomplish to support both platforms.

    You can also create different layouts for different API levels, you can also check at runtime to see if a class/method is supported before using it, but that can add a lot of overhead to your code.

    This requires care since it’s quite easy to include and API that won’t work on the lowest level you have chosen to support yet misses getting exercised in your emulator testing.

    My approach when I feel I have to do that is to compile with the lowest API level (API properties in the project) and make sure all such cases are known and handled in code, by versioning layouts, or are understood and have been exercised

    Then switch back to the higher API, you have to be disciplined to do this or risk crashes in a release, honestly it’s usually not worth the effort because you can almost always find a x-api work around, but every case is different.

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

Sidebar

Related Questions

I can use android:gravity=bottom|center_horizontal in xml on a textview to get my desired results,
For some reasons I can't use xml layout files. But I need to create
http://developer.android.com/reference/android/widget/TextView.html#attr_android:password I can't find where in the android code it applied the android:password xml
I have an android.graphics.bitmap and an android.net.Uri both of these I can use anyway
How can we use Web services in Android Applications?
R class on android has it's limitations. You can't use the resources dynamically for
The documentation ( http://developer.android.com/guide/topics/manifest/manifest-element.html#uid ) only states I can't use raw strings and the
im wondering if we can develop our android app in any computer we use
I know I can use android.text.format.DateFormat.getDateFormat() to format my dates, and android.text.format.DateFormat.getTimeFormat to format
I am finding it difficult in understanding how I can use the android accelerometer

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.