0

I am a relatively new android developer. I am trying to set a photoshopped image as the background of an activity.

I understand that i can do this by setting the android:background attribute in the root view of the layout, or like this by using imageview in framelayout:

<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent">

<ImageView
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:scaleType="fitXY"
    android:src="@drawable/background"/>

<LinearLayout
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:focusable="true"
android:focusableInTouchMode="true"
android:minWidth="25px"
android:minHeight="25px" >

--> other views

Now here is the problem. Whenever I insert an image of a large resolution (1562*2779 to be precise), the image does not appear at all when i deploy to the device (although it is showing perfectly in the preview mode).

Also, I noted that images of smaller sizes (e.g 390*720) were showing correctly on my device. How to correct this? is there a mechanism to use the large image as a background for all devices?

Shahbaaz90
  • 33
  • 6

0 Answers0