Possible Duplicate:
Android CalendarView class cannot be found的DatePicker不工作時,試圖用它
我試圖把一個日期選取器在我的佈局,但替代的DatePicker那隻能說明:DatePicker
與此錯誤: The following classes could not be found: - DatePicker (Change to android.widget.DatePicker, Fix Build Path, Edit XML)
我不知道這是什麼,因爲我已經在我的應用程序中有一個DatePicker,它工作正常,只是不知道爲什麼這個現在不工作。
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical"
tools:ignore="HardcodedText" >
<TextView
android:id="@+id/tvNomeR"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvDataR"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/textView3"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<TextView
android:id="@+id/tvMensagemR"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="" />
<DatePicker
android:id="@+id/datePicker1"
android:layout_width="wrap_content"
android:layout_height="wrap_content" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent" >
<Button
android:id="@+id/bAdiarR"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Adiar" />
<Button
android:id="@+id/bResponderR"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:text="Responder" />
</LinearLayout >
</LinearLayout>
沒有向我們展示相關的代碼,幾乎不可能知道你做錯了什麼。 – Sam
您可能缺少「import」語句 –
問題陳述尚不清楚。請放一些代碼。究竟你在哪裏收到這個錯誤? –