Hi @all,

I wrote a test case with ActivityUnitTestCase which was working fine.

Now I added a dimensions file (dimens.xml) and using the values with a
style.xml.

Here some parts from the dimens.xml:

<resources>
  <eat-comment/>
  <dimen name="my_height">15dp</dimen>
<resources>

Here the attrs.xml:
<resources>
  <declare-styleable name="Theme">
    <attr name="theHeight" format="dimension" />
  </declare-styleable>
</resources>

And here the style.xml:
<resources>
  <style name="myStyle">
    <item name="android:layout_height">@dimen/my_height</item>
    <item name="android:paddingLeft">?theHeight</item>
  </style>
</resources>

The style.xml is in the android manifest.

On the G1 and the emulator the code works fine. In the test case I'm
getting a crash.

05-10 15:03:48.658: INFO/TestRunner(748):
java.lang.UnsupportedOperationException: Can't convert to dimension:
type=0x2

>From the call stack I can see that this line causes the crash:

    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        this.setContentView(R.layout.my_layout);
   }

Any idea?

T-Droid

-- 
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Reply via email to