App Is Crashing When I Am Inserting Background Image
my app is crashing when I am inserting an image and I am not getting log report too when I am writing android:background='@drawable/logo' my app is crashing
Solution 1:
The problem is you probably testing on lower API version then API24. So it will throw ResourceNotFoundException
cause drawable does not exists for it .
So You have to have a copy of it normal drawable folder drawable . Or in all drawable-v24, drawable-v21 and drawable . put the drawable in all folder most importantly in drawable
.
drawabledrawable-v21drawable-v24
Solution 2:
please put crashing text or you can replace this code
<?xml version="1.0" encoding="utf-8"?><RelativeLayoutxmlns:android="http://schemas.android.com/apk/res/android"xmlns:app="http://schemas.android.com/apk/res-auto"xmlns:tools="http://schemas.android.com/tools"tools:context="com.android.spotsdialog.MainActivity"android:layout_width="match_parent"android:layout_height="match_parent"><ImageViewandroid:id="@+id/rootLayout"android:layout_width="match_parent"android:layout_height="match_parent"android:src="@drawable/logo"
/>
</RelativeLayout >
Post a Comment for "App Is Crashing When I Am Inserting Background Image"