Android Question Strange lag/bad performance when switching layouts in a panel

Yuri Cinesi

Active Member
Licensed User
I have an app that has a top bar with a button to show a sliding menu (done with slidingmenuwrapper) and a label that indicates what "page" you're currently on. The rest of the UI is a Panel.

The menu contains some buttons that allow you to switch between several pages by loading different layouts in the panel. Whenever I load a different layout than the first one the entire app seems to lag. As soon as I switch back to the initial layout this lag disappears. I don't think it's related to the amount of objects present in the layouts as one of them is comprised only of a single imageview (since it's still WIP).

I don't know what could be causing this lag. I can post the entire project if necessary, or any relevant parts since it's pretty big. Any help is highly appreciated.
 

Yuri Cinesi

Active Member
Licensed User
Fixed it. Basically I had an imageview within the slidingmenu that was just completely black, to act as a line between the menu and the rest of the UI. The image I loaded into it was about 20kb and apparently too large. Making it smaller (about 1kb) fixed the issue completely.
Still not sure why the lag was so inconsistent, but whatever. It's gone now.
 
Upvote 0

RandomCoder

Well-Known Member
Licensed User
Longtime User
If the Imageview is just a black image then it might be better/faster and far less memory consuming to use a panel with a black background?
Just an idea for you to consider.
 
Upvote 0
Top