开发者

Android 1.5-specific error

I am having trouble with with getting my application to function on android 1.5. It works fine in 1.6, 2.1, and 2.2 but whenever I attempt to run it in 1.5, I get an immediate force close with the LogCat output:

java.lang.RuntimeException: Unable to start activity
ComponentInfo{com.qrohlf.activites/com.qrohlf.activites.BookmarkHistoryTabActivity}:
android.view.InflateException: Binary XML file line #2: Error inflating class
java.lang.reflect.Constructor

This strikes me as very odd, as line #2 of my layout XML is just

<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"

Any ideas? Is there some major API change between 1.5 and 1.6 in the way layout XMLs are done that I'm missing? (I've included the rest of my layout xml below for reference)

<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:orientation="vertical"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent">
    <include android:id="@+id/custom_titlebar" layout="@layout/custom_titlebar" />
    <ViewFlipper android:id="@+id/frame_content" 
        android开发者_Python百科:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:layout_weight="1" >
        <ListView android:id="@+id/soccerteams_listview"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="#FFFFFFFF"/>
        <ListView android:id="@+id/countries_listview"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:background="#FFFFFFFF"/>
    </ViewFlipper>
    <LinearLayout
        android:orientation="horizontal"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:gravity="center_horizontal"
        android:background="@android:color/black"
        android:padding="0px">
        <Button android:id="@+id/bookmarks_button"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/bookmarks"
            android:textColor="@android:color/primary_text_dark"
            android:drawableTop="@drawable/ic_bookmark_tab" 
            android:background="@drawable/tab_background"
            android:layout_weight="1"/>
        <Button android:id="@+id/history_button"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:text="@string/history"
            android:textColor="@android:color/primary_text_dark"
            android:drawableTop="@drawable/ic_history_tab" 
            android:background="@drawable/tab_background"
            android:layout_weight="1"/>
    </LinearLayout>
</LinearLayout>


Please ensure you have al required drawables in "drawable" directory. 1.5 doesn't understand "drawable-hdpi" directory and others, it only knows "drawable".

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜