1

我在 Google Play 上有一个应用程序。我已经集成了 BugSense。一切都正常工作突然我在下面的 xml 中的第一行第一个控件上遇到了 3 个错误。我不知道为什么会发生这种情况,在其他 android 设备上它工作正常。有任何想法吗?

<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="fill_parent"
    android:layout_height="fill_parent"
    android:background="@color/black_text"
    >

    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
        android:layout_width="fill_parent"
        android:layout_height="wrap_content"
        android:background="@color/black_text"
        android:layout_above="@+id/relativeView_fav_shows"
        >
        <ImageView
            android:id="@+id/imageView1"
            android:layout_width="fill_parent"
            android:layout_height="fill_parent"
            android:layout_centerVertical="true"
            android:scaleType="centerCrop"
            android:src="@drawable/background_channel"
            />

        <GridView xmlns:android="http://schemas.android.com/apk/res/android"
            android:id="@+id/gridview_channelView"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:numColumns="2"
            android:verticalSpacing="5dp"
            android:horizontalSpacing="5dp"
            android:stretchMode="columnWidth"
            android:listSelector="@null"
            android:layout_marginTop="6dp"
            android:gravity="center"
            >

        </GridView>

    </RelativeLayout>
    <RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
            android:layout_width="fill_parent"
            android:layout_height="wrap_content"
            android:background="@color/black_text"
            android:layout_below="@+id/gridview_channelView"
            android:layout_alignParentBottom="true"
            android:id="@+id/relativeView_fav_shows"
            >
            <ImageView
                android:id="@+id/imageView_favShows"
                android:layout_width="fill_parent"
                android:layout_height="wrap_content"
                android:src="@drawable/fav_shows_normal"
                />
    </RelativeLayout>
</RelativeLayout>

Logcat 输出。

java.lang.RuntimeException: Unable to start activity ComponentInfo{com.microeyes.hindiserials/com.microeyes.hindiserials.ChannelMainActivity}: android.view.InflateException: Binary XML file line #14: Error inflating class
1   at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1659)
2   at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1675)
3   at android.app.ActivityThread.access$1500(ActivityThread.java:121)
4   at android.app.ActivityThread$H.handleMessage(ActivityThread.java:943)
5   at android.os.Handler.dispatchMessage(Handler.java:99)

谢谢

4

1 回答 1

1

这个下面的标签应该只在顶级父布局中可用,从所有其他的Laoyts/Views中删除它。

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

这可能是错误的原因,请也发布 logcat 输出。

于 2012-07-29T07:19:26.050 回答