That layout works fine for me in the m5 sdk. Are you sure it's the
exact xml? It's missing the xmlns, I just want to make sure it's not
missing something else that would cause that.

On a side note, during testing of this, I apparently caused a
NullPointerException in DatePicker by firing a key event. I was using
the posted xml and the only code I had was the setContentView call to
that layout.

ERROR/AndroidRuntime(605): java.lang.NullPointerException
ERROR/AndroidRuntime(605):     at android.widget.DatePicker
$1.onKey(DatePicker.java:193)
ERROR/AndroidRuntime(605):     at
android.view.View.dispatchKeyEvent(View.java:2684)
ERROR/AndroidRuntime(605):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:529)
ERROR/AndroidRuntime(605):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/AndroidRuntime(605):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/AndroidRuntime(605):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/AndroidRuntime(605):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/AndroidRuntime(605):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/AndroidRuntime(605):     at
android.view.ViewGroup.dispatchKeyEvent(ViewGroup.java:531)
ERROR/AndroidRuntime(605):     at android.policy.PhoneWindow
$DecorView.superDispatchKeyEvent(PhoneWindow.java:1189)
ERROR/AndroidRuntime(605):     at
android.policy.PhoneWindow.superDispatchKeyEvent(PhoneWindow.java:871)
ERROR/AndroidRuntime(605):     at
android.app.Activity.dispatchKeyEvent(Activity.java:1503)
ERROR/AndroidRuntime(605):     at android.policy.PhoneWindow
$DecorView.dispatchKeyEvent(PhoneWindow.java:1164)
ERROR/AndroidRuntime(605):     at
android.view.ViewRoot.deliverKeyEvent(ViewRoot.java:926)
ERROR/AndroidRuntime(605):     at
android.view.ViewRoot.handleMessage(ViewRoot.java:595)
ERROR/AndroidRuntime(605):     at
android.os.Handler.dispatchMessage(Handler.java:80)
ERROR/AndroidRuntime(605):     at android.os.Looper.loop(Looper.java:
91)
ERROR/AndroidRuntime(605):     at
android.app.ActivityThread.main(ActivityThread.java:3052)
ERROR/AndroidRuntime(605):     at
java.lang.reflect.Method.invokeNative(Native Method)
ERROR/AndroidRuntime(605):     at
java.lang.reflect.Method.invoke(Method.java:356)
ERROR/AndroidRuntime(605):     at android.os.ZygoteInit
$MethodAndArgsCaller.run(ZygoteInit.java:1547)
ERROR/AndroidRuntime(605):     at
android.os.ZygoteInit.main(ZygoteInit.java:1445)
ERROR/AndroidRuntime(605):     at
android.dalvik.NativeStart.main(Native Method)

On Mar 31, 2:46 am, "Analdin Judy" <[EMAIL PROTECTED]> wrote:
> hi,
>
>    I use the below code
>
> <FrameLayout
>
> id="@+id/datepicker"
>
> android:layout_width="fill_parent"
>
> android:layout_height="fill_parent"
>
> android:layout_x="100.0sp"
>
> android:layout_y="240.0sp"
>
>
>
> <DatePicker id="@+id/trans_date"
>
> android:layout_width="wrap_content"
>
> android:layout_height="wrap_content"
>
> android:layout_x="100.0sp"
>
> android:layout_y="210.0sp"
>
> />
>
> </FrameLayout>
>
> I got the below error.
>
> "You must  supply a layout_width attribute"
>
> What is the reason for the above error?
>
> Thanks
>
> judy
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Beginners" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-beginners?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to