I've got an Activity
made by XML, I've set it's background to a background image I have in my drawable folder.
In the same activity I've created a ViewPager
to allow swiping back and forth between views.
All the views inside the ViewPager
contain one image.
Whenever I swipe left or right, the transition is very slow.
I tried removing the background image by setting it to white (#fff) and all the lag was gone. It worked perfect! The problem is that I do need that background for the application.
Is there any way to optimize a background image or something so swiping will go smoothly again? Currently it's too frustrating to use because of the lag.
I also tried cropping the image to a small size and then just stretched it over the screen, but I didn't notice any performance improvements. Also it's not the images fault that are located in the ViewPager
, when I tested it with TextViews instead there was the same lag.