Android – App crashes on nexus 4 (4.4.4) due to background image

I have set the background picture as the root layout. This works correctly for nexus 5 (5.0.1) and nexus 5x (6.0.1). However, when the nexus 4 (4.4.4) application crashes, the following error occurs

This is an XML file

<?xml version="1.0" encoding="utf-8"?>
    <RelativeLayout 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:background="@drawable/backgraound">


        <ScrollView
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:scrollbars="none">

            <LinearLayout
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:orientation="vertical">
       // other view
     </LinearLayout>
        </ScrollView>
    </RelativeLayout>

If I delete the background image from the XML, this also applies to nexus 4. How can I solve this problem? Thank you in advance

resolvent:

You may have put your images in the drawable-v21 folder of API level 21 and later. These folders are dedicated to loop and loop versions. That's why it can't be used in KitKat or earlier. Put your pictures in a paintable folder so that all API versions can access it. Happy to help

The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
分享
二维码
< <上一篇
下一篇>>