1

I have a dimen specified in values/ and values-w600dp/ because I would like an icon to be wider on very wide screens.

values/

<dimen name="myIconWidth">32dp</dimen>

values-w600dp/

<dimen name="myIconWidth">48dp</dimen>

layout/

<ImageButton android:layout_width="@dimen/myIconWidth" ...

However, I am currently manually handling the orientation change:

Manifest:

android:configChanges="orientation|..."

Therefore, the layout_width still uses the (potentially incorrect) old value after the orientation change.

How best to update the layout_width (presumably in the onSizeChanged() method)?

Mark
  • 7,446
  • 5
  • 55
  • 75

1 Answers1

0

because of use android:configChanges="orientation|..." if you use this attr then android never create new view for you so,you have to handle it in your onConfig method of activity i think you did it,but you have given name of layout file while in landscape mode or portrait mode

Thank you

Bhavdip Sagar
  • 1,951
  • 15
  • 27
  • Thanks, that's true and that's pretty much what I said in the question. Unfortunately, it doesn't answer the question. – Mark Dec 28 '12 at 10:00
  • hi as per your question you did not create layout--w600 folder just create it put your layout file here because "values-w600dp/" always render during layout-w600 – Bhavdip Sagar Dec 28 '12 at 10:04
  • why would it "render" layout-w600dp but not values-600dp? – Mark Dec 31 '12 at 12:43
  • i think your need to check Qualifier name rules of android values-600dp never come it should be Version (API level) [for example : values-14] . – Bhavdip Sagar Jan 01 '13 at 04:39
  • sorry, but that is not relevant to this discussion. – Mark Jan 01 '13 at 13:48