2 messages in com.googlegroups.android-beginnersRe: Error in datepicker
FromSent OnAttachments
Analdin Judy31 Mar 2008 02:46 
Dan U.31 Mar 2008 12:05 
Subject:Re: Error in datepicker
From:Dan U. (dan.@gmail.com)
Date:03/31/2008 12:05:06 PM
List:com.googlegroups.android-beginners

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" <j.@i-waves.com> 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