Android 1.5特定错误
我很难让我的应用程序在安卓1.5上运行。它在1.6、2.1和2.2中运行良好,但每当我尝试在1.5中运行它时,就会立即得到一个力,与LogCat输出接近:Android 1.5特定错误,android,android-layout,Android,Android Layout,我很难让我的应用程序在安卓1.5上运行。它在1.6、2.1和2.2中运行良好,但每当我尝试在1.5中运行它时,就会立即得到一个力,与LogCat输出接近: java.lang.RuntimeException: Unable to start activity ComponentInfo{com.qrohlf.activites/com.qrohlf.activites.BookmarkHistoryTabActivity}: android.view.InflateException: Bin
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
这让我感到非常奇怪,因为我的布局XML的第2行只是
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
请确保在“drawable”目录中有所有必需的drawable。1.5不理解“drawable hdpi”目录和其他目录,它只知道“drawable”。谢谢-经过一些进一步的研究,我自己解决了这个问题,但这就是问题所在。请发布完整的堆栈跟踪。我想问题一定出在包含中,也发布布局=),但正如Romain所说,发布堆栈跟踪:)
<?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: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>