Android ICS上的时间选择器NullPointerException

Android ICS上的时间选择器NullPointerException,android,nullpointerexception,android-4.0-ice-cream-sandwich,timepicker,Android,Nullpointerexception,Android 4.0 Ice Cream Sandwich,Timepicker,好的,我刚刚将我的TimePickerDialog切换到了一个TimePicker小部件,因为客户的需求,它直接显示在我正在进行的活动中 问题是,当我按下所说的时间选择器上的任何箭头时,我会得到一个NullPointerException 只是澄清一下,除了我的活动的onCreate()方法中的这一行之外,没有任何代码附加到TimePicker: ((时间选择器)findViewById(R.id.time\u选择器))。设置为24小时视图(true) 我在谷歌论坛上找到了关于这个问题的信息,但

好的,我刚刚将我的
TimePickerDialog
切换到了一个
TimePicker
小部件,因为客户的需求,它直接显示在我正在进行的活动中

问题是,当我按下所说的
时间选择器
上的任何箭头时,我会得到一个NullPointerException

只是澄清一下,除了我的活动的
onCreate()
方法中的这一行之外,没有任何代码附加到
TimePicker

((时间选择器)findViewById(R.id.time\u选择器))。设置为24小时视图(true)

我在谷歌论坛上找到了关于这个问题的信息,但没有多少帮助

很遗憾,我不认为这会有多大帮助


此问题仅在ICS(Android 4.0+)中测试时出现。有人能够解决这个问题吗?

刚刚编写了一个示例应用程序,在Galaxy SIII(4.0)中没有发现错误:

以及布局xml:

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:orientation="vertical" >

    <TimePicker android:id="@+id/tp_time"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />

    <TextView   android:id="@+id/tv_time"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />
</LinearLayout>


仅供参考:

我无法复制它!!!!你是否设置了一个时间选择器侦听器?有同样的问题,但我在4.0中运行了一个简单的应用程序,它可以工作。隐马尔可夫模型。
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout   xmlns:android="http://schemas.android.com/apk/res/android"
                android:layout_width="fill_parent"
                android:layout_height="fill_parent"
                android:orientation="vertical" >

    <TimePicker android:id="@+id/tp_time"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />

    <TextView   android:id="@+id/tv_time"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content" />
</LinearLayout>