开发者

Bug with my Android application

开发者 https://www.devze.com 2023-03-26 22:10 出处:网络
It doesnt work if I add the prebuilt calender, digital clock and analog clock that comes with the androids development environment..开发者_如何学Go.

It doesnt work if I add the prebuilt calender, digital clock and analog clock that comes with the androids development environment..开发者_如何学Go.

        <DigitalClock android:layout_alignParentRight="true" 
    android:layout_width="wrap_content" android:text="DigitalClock"
     android:layout_height="wrap_content" android:id="@+id/digitalClock1"></DigitalClock>

    <AnalogClock android:id="@+id/analogClock1" 
    android:layout_height="wrap_content"
     android:layout_width="wrap_content"
     android:layout_alignParentTop="true"></AnalogClock>

    <CalendarView 
    android:layout_height="wrap_content" 
    android:layout_width="wrap_content"
     android:id="@+id/calendarView1" 
     android:layout_toRightOf="@+id/analogClock1"
     android:layout_below="@+id/digitalClock1"
     android:layout_alignParentRight="true"></CalendarView> 

Why..

ps.I tested without that chunk of code..the application runs perfectly


If you look carefully at the CalendarView documentation, you'll find this:

Since: API Level 11

Which means it was introduced in Android 3.0 Honeycomb (which is not currently available for phones). Thus, if you were testing on a phone (or a pre-3.0 emulator), you'll get a ClassNotFoundException (I think), telling you it can't find CalendarView.

The reason why Eclipse is not telling you about this is probably that you have set the target SDK for your project to 11 or higher.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号