Q:

Background image for android app screen

I want to set this image as background for my app but to no avail:

https://www.google.co.in/search?q=chalk+board&espv=2&biw=1484&bih=777&site=webhp&tbm=isch&imgil=JtRlMEFBw1_A-M%253A%253B9JmQtC9sRdMPkM%253Bhttp%25253A%25252F%25252Faspireblog.org%25252Fhigher-ed%25252Fa-journey-from-dirt-poor-to-a-masters-degree%25252Fattachment%25252Fchalkboard%25252F&source=iu&pf=m&fir=JtRlMEFBw1_A-M%253A%252C9JmQtC9sRdMPkM%252C_&usg=__eE7zC2LFHb8TNIs9rjp6G4eqos4%3D&ved=0ahUKEwjK9dfgxpXLAhUQB44KHUNuDPsQyjcIRQ&ei=dlXQVsriOJCOuATD3LHYDw#imgrc=9SRpOnqY7vwJeM%3A

My log cat:

FATAL EXCEPTION: main
                                                     java.lang.RuntimeException: Unable to start activity
  ComponentInfo{autogenie.touch2/autogenie.touch2.MainActivity}:
  android.view.InflateException: Binary XML file line #2: Error
  inflating class android.widget.RelativeLayout
                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2180)
                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230)
                                                         at android.app.ActivityThread.access$600(ActivityThread.java:141)
                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234)
                                                         at android.os.Handler.dispatchMessage(Handler.java:99)
                                                         at android.os.Looper.loop(Looper.java:137)
                                                         at android.app.ActivityThread.main(ActivityThread.java:5041)
                                                         at java.lang.reflect.Method.invokeNative(Native Method)
                                                         at java.lang.reflect.Method.invoke(Method.java:511)
                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793)
                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560)
                                                         at dalvik.system.NativeStart.main(Native Method)
                                                      Caused by: android.view.InflateException: Binary XML file line #2: Error
  inflating class android.widget.RelativeLayout
                                                         at android.view.LayoutInflater.createView(LayoutInflater.java:613)
                                                         at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
                                                         at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
                                                         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
                                                         at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
                                                         at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
                                                         at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
                                                         at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256)
                                                         at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109)
                                                         at autogenie.touch2.MainActivity.onCreate(MainActivity.java:27)
                                                         at android.app.Activity.performCreate(Activity.java:5104)
                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080)
                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144)
                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 
                                                         at android.app.ActivityThread.access$600(ActivityThread.java:141) 
                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 
                                                         at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                         at android.os.Looper.loop(Looper.java:137) 
                                                         at android.app.ActivityThread.main(ActivityThread.java:5041) 
                                                         at java.lang.reflect.Method.invokeNative(Native Method) 
                                                         at java.lang.reflect.Method.invoke(Method.java:511) 
                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 
                                                         at dalvik.system.NativeStart.main(Native Method) 
                                                      Caused by: java.lang.reflect.InvocationTargetException
                                                         at java.lang.reflect.Constructor.constructNative(Native Method)
                                                         at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
                                                         at android.view.LayoutInflater.createView(LayoutInflater.java:587)
                                                         at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
                                                         at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660) 
                                                         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) 
                                                         at android.view.LayoutInflater.inflate(LayoutInflater.java:466) 
                                                         at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 
                                                         at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 
                                                         at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256) 
                                                         at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
                                                         at autogenie.touch2.MainActivity.onCreate(MainActivity.java:27) 
                                                         at android.app.Activity.performCreate(Activity.java:5104) 
                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 
                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) 
                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 
                                                         at android.app.ActivityThread.access$600(ActivityThread.java:141) 
                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 
                                                         at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                         at android.os.Looper.loop(Looper.java:137) 
                                                         at android.app.ActivityThread.main(ActivityThread.java:5041) 
                                                         at java.lang.reflect.Method.invokeNative(Native Method) 
                                                         at java.lang.reflect.Method.invoke(Method.java:511) 
                                                         at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:793) 
                                                         at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:560) 
                                                         at dalvik.system.NativeStart.main(Native Method) 
                                                      Caused by: java.lang.OutOfMemoryError
                                                         at android.graphics.BitmapFactory.nativeDecodeAsset(Native Method)
                                                         at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:502)
                                                         at android.graphics.BitmapFactory.decodeResourceStream(BitmapFactory.java:355)
                                                         at android.graphics.drawable.Drawable.createFromResourceStream(Drawable.java:785)
                                                         at android.content.res.Resources.loadDrawable(Resources.java:1965)
                                                         at android.content.res.TypedArray.getDrawable(TypedArray.java:601)
                                                         at android.view.View.(View.java:3330)
                                                         at android.view.View.(View.java:3259)
                                                         at android.view.ViewGroup.(ViewGroup.java:425)
                                                         at android.widget.RelativeLayout.(RelativeLayout.java:210)
                                                         at java.lang.reflect.Constructor.constructNative(Native Method) 
                                                         at java.lang.reflect.Constructor.newInstance(Constructor.java:417) 
                                                         at android.view.LayoutInflater.createView(LayoutInflater.java:587) 
                                                         at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56) 
                                                         at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660) 
                                                         at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685) 
                                                         at android.view.LayoutInflater.inflate(LayoutInflater.java:466) 
                                                         at android.view.LayoutInflater.inflate(LayoutInflater.java:396) 
                                                         at android.view.LayoutInflater.inflate(LayoutInflater.java:352) 
                                                         at android.support.v7.app.AppCompatDelegateImplV7.setContentView(AppCompatDelegateImplV7.java:256) 
                                                         at android.support.v7.app.AppCompatActivity.setContentView(AppCompatActivity.java:109) 
                                                         at autogenie.touch2.MainActivity.onCreate(MainActivity.java:27) 
                                                         at android.app.Activity.performCreate(Activity.java:5104) 
                                                         at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1080) 
                                                         at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2144) 
                                                         at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2230) 
                                                         at android.app.ActivityThread.access$600(ActivityThread.java:141) 
                                                         at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1234) 
                                                         at android.os.Handler.dispatchMessage(Handler.java:99) 
                                                         at android.os.Looper.loop(Looper.java:137) 
                                                         at android.app.ActivityThread.main(ActivityThread.java:5041) 
                                                         at java.lang.reflect.Method.invokeNative(Native Method) 
                                                         at java.lang.reflect.Method.invoke(Method.java:511)

Activity main.xml:
<?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:paddingBottom="@dimen/activity_vertical_margin"
    android:paddingLeft="@dimen/activity_horizontal_margin"
    android:paddingRight="@dimen/activity_horizontal_margin"
    android:paddingTop="@dimen/activity_vertical_margin"
    tools:context="autogenie.touch2.MainActivity"
    android:background="@drawable/chalkboard">

    <autogenie.touch2.Circle
        android:id="@+id/circle"
        android:layout_centerInParent="true"
        android:layout_width="300dp"
        android:layout_height="300dp" />

</RelativeLayout>

A:

I had this problem too.My problem comes when i use a big image like your etc. 3000x2000px and on some device crash for outOfMemmory.. Try to resize the image i think that the crash comes from too big images. Hope to work for you!

