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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T16:40:30+00:00 2026-05-31T16:40:30+00:00

I have a problem concerning the width of a DialogPreference in Android. According to

  • 0

I have a problem concerning the width of a DialogPreference in Android. According to the width of the DialogPreference, I set the margin of a text field so that its position is aligned with the thumb position of a seek bar. This works fine when dragging the thumb.

But when I show the DialogPreference, the width has not yet been set and is always 0. Therefore, the initial position of my TextView is always 0 until I drag the seek bar for the first time.

I cannot find a suitable callback within the class that is called when the width is set (something similar to onSizeChanged() would be great).

Is there a callback or a trick that I can use?

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

    The solution is pretty complex. You have to create your own widget derived from a standard widget (a widget that must be used in your dialog layout). You use this widget instead of the standard widget in the layout used by your dialog preference.

    Then, you add a callback handler interface and a callback handler to this new widget. Afterwards, you can override onDraw() and call your callback handler before calling super.onDraw().

    Now, when you implement the callback listener in your dialog preference class and assign it to this widget, you get an onDraw() callback. When this callback is called, all the width and height values have been set and you can work with them.

    I know that this is a dirty hack, but I didn’t find anything better.

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

Sidebar

Related Questions

I'm new to flex and I have a question concerning bitmapData and its width
I've got a problem concerning android layouts. In my xml file I have two
i have the following problem concerning the index:: my source code:: <table style=width: 80%>
I have a strange problem concerning a layout in my Android app (I'm learning
I have problem concerning python packages and testing. I'm writing an application using wx
i have a problem concerning a select query in MYSQL i have two different
I am using LaTeX and I have a problem concerning string manipulation. I want
i am currently working on a facebook game and i have a problem concerning
I have quite a problem concerning the use of relational database concepts in Delphi
I'm a beginner concerning socket programming and I have a problem when I send

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.