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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T10:09:12+00:00 2026-05-26T10:09:12+00:00

I would like to retrieve the int value of textApperanceLarge in code. I believe

  • 0

I would like to retrieve the int value of textApperanceLarge in code. I believe that the below code is going in the right direction, but can’t figure out how to extract the int value from the TypedValue.

TypedValue typedValue = new TypedValue(); 
((Activity)context).getTheme().resolveAttribute(android.R.attr.textAppearanceLarge, typedValue, true);
  • 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-26T10:09:13+00:00Added an answer on May 26, 2026 at 10:09 am

    Your code only gets the resource ID of the style that the textAppearanceLarge attribute points to, namely TextAppearance.Large as Reno points out.

    To get the textSize attribute value from the style, just add this code:

    int[] textSizeAttr = new int[] { android.R.attr.textSize };
    int indexOfAttrTextSize = 0;
    TypedArray a = context.obtainStyledAttributes(typedValue.data, textSizeAttr);
    int textSize = a.getDimensionPixelSize(indexOfAttrTextSize, -1);
    a.recycle();
    

    Now textSize will be the text size in pixels of the style that textApperanceLarge points to, or -1 if it wasn’t set. This is assuming typedValue.type was of type TYPE_REFERENCE to begin with, so you should check that first.

    The number 16973890 comes from the fact that it is the resource ID of TextAppearance.Large

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

Sidebar

Related Questions

I would like to retrieve the ethernet address of the network interface that is
I would like to retrieve an ordered query result, but I need to have
I am adding data to my database, but would like to retrieve the UnitID
I would like to know what is the correct way to retrieve the value
I would like to retrieve at runtime the values for the dialect and connection.driver_class
I would like to retrieve the AppSetting key from the assembly config file called:
I would like to retrieve the contents of a file, filter and modify them
I am saving images to the photo library and would like to retrieve them
I have a reference to a type, for which I would like to retrieve
I have a 3-leveled hierarchy of entities: Customer-Order-Line, which I would like to retrieve

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.