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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:27:12+00:00 2026-05-24T16:27:12+00:00

I came to a problem that the only solutions is using a AbsoluteLayout (Just

  • 0

I came to a problem that the only solutions is using a AbsoluteLayout (Just to show something at specific positions).

I’m trying to copy the AbsoluteLayout class to avoid it being removed on future releases and my app stop working.

I’m copying from here: http://www.google.com/codesearch#cZwlSNS7aEw/frameworks/base/core/java/android/widget/AbsoluteLayout.java&exact_package=android&q=AbsoluteLayout&type=cs

But getting this code, first, I changed all the mPadding(Direction) to getPadding(Direction), but there’s still an error on the LayoutParams constructor:

    public LayoutParams(Context c, AttributeSet attrs) {
        super(c, attrs);
        TypedArray a = c.obtainStyledAttributes(attrs,
                com.android.internal.R.styleable.AbsoluteLayout_Layout);
        x = a.getDimensionPixelOffset(
                com.android.internal.R.styleable.AbsoluteLayout_Layout_layout_x, 0);
        y = a.getDimensionPixelOffset(
                com.android.internal.R.styleable.AbsoluteLayout_Layout_layout_y, 0);
        a.recycle();
    }

com.android.internal.R cannot be resolved to a variable

How can I get these values? Or someone already has this class independently that don’t belong to google wishes to keep on the API?

  • 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-24T16:27:13+00:00Added an answer on May 24, 2026 at 4:27 pm

    You need to copy over declare-styleable entry from attrs.xml:

    <declare-styleable name="AbsoluteLayout_Layout">
        <attr name="layout_x" format="dimension" />
        <attr name="layout_y" format="dimension" />
    </declare-styleable>
    

    Just add res/values/attrs.xml file to your application and copy above lines there.


    When this is done, update your code to reference R from your package:

    import com.your.package.R;
    ...
    public LayoutParams(Context c, AttributeSet attrs) {
        super(c, attrs);
        TypedArray a = c.obtainStyledAttributes(attrs,
                R.styleable.AbsoluteLayout_Layout);
        x = a.getDimensionPixelOffset(
                R.styleable.AbsoluteLayout_Layout_layout_x, 0);
        y = a.getDimensionPixelOffset(
                R.styleable.AbsoluteLayout_Layout_layout_y, 0);
        a.recycle();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have the problem that an specific step in Ant can only be executed
I came across a problem in my current application that required fiddling with the
I came accross a very strange problem with tr1::regex (VS2008) that I can't figure
The Problem It's something I came across a while back and was able to
A colleague came to me with a problem that I managed to answer but
I am trying to get started with OOAD, this problem came to my mind
I came across this problem while preparing for an interview and curious to know
I came across a problem I cannot solve on my own concerning the downloadable
Today I came across a problem where someone had accidentally committed a proj.user file
Today we came accross a problem concerning static member functions in an multithreaded environment.

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.