Android backgroud image slow the app

0 votes

For the left slide menu, I'm using DrawerLayout. When I use an image as the background, my app becomes sluggish. However, it is smooth when I use color as the background.

my code is

<android.support.v4.widget.DrawerLayout    
xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/drawer_layout"
android:layout_width="match_parent"
android:background="@drawable/app_bg"
android:layout_height="match_parent" >

<FrameLayout
    android:id="@+id/content_frame"
    android:layout_width="match_parent"
    android:layout_height="match_parent" />

<ListView
    android:id="@+id/left_drawer"
    android:layout_width="240dp"
    android:layout_height="match_parent"
    android:layout_gravity="start"
    android:background="@android:color/white"
    android:choiceMode="singleChoice"
    android:divider="@android:color/transparent"
    android:dividerHeight="0dp" />

</android.support.v4.widget.DrawerLayout>

This background image is from the app @drawable/bg. I have no idea how to get around this and perform a nice sliding action.

My background image .

enter image description here

Nov 10 in Android by Edureka
• 12,390 points
33 views

1 answer to this question.

0 votes
You're mainly noticing the latency because you need to copy your background image to each of the drawable folders (drawable-hdpi, drawable-xhdpi, etc.). I automate using the Android Drawable Importer plugin for Android Studio. Works perfectly.
answered Nov 10 by Edureka
• 10,880 points

Related Questions In Android

0 votes
0 answers

Android: why the ICICI iMobile Pay App shows the "rooted/jailbroken" device with my app?

The ICICI iMobile Pay app displays the ...READ MORE

Nov 9 in Android by Edureka
• 10,880 points
38 views
0 votes
0 answers

How to implement the system lock screen in your own android app?

How should the system lock screen be ...READ MORE

Nov 22 in Android by Edureka
• 10,880 points
11 views
0 votes
0 answers
0 votes
0 answers

Android Studio: Where is the Compiler Error Output Window?

When I "Run" my project in Android ...READ MORE

Sep 21 in Android by Edureka
• 12,390 points
40 views
0 votes
1 answer

Android backgroud image slow the app

You should have diferentiate sizes for deferent ...READ MORE

answered Jun 16 in Others by polo
• 1,480 points
68 views
0 votes
1 answer

How to get Bitmap from an Uri?

Try using the following lines of code ...READ MORE

answered Feb 18 in Others by Aditya
• 7,660 points
4,006 views
0 votes
0 answers

How to put a border around an Android TextView?

Is it possible to draw a border ...READ MORE

Nov 23 in Android by Ashwini
• 2,760 points
35 views
0 votes
1 answer

Running docker on Android

According to the documentation, the Android kernel is ...READ MORE

answered Aug 1, 2018 in Docker by Kalgi
• 52,350 points
3,027 views
0 votes
1 answer
0 votes
1 answer

Android in-app billing - How to handle refunds ?

Simply disregard the library's purchase to overcome ...READ MORE

answered Nov 10 in Android by Edureka
• 10,880 points
56 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP