Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Sudden lag spikes when editing .xml layout files

When I'm editing XML files in Android Studio, for some reason it lags when scrolling, typing or anything else. For comparison, editing .java files isn't a problem.

Any ideas on how I can prevent these sudden spikes? They are really annoying when it takes 30 seconds to scroll through a 500 line .xml file, but only 10 seconds on a twice as big java file... My point, is there any way to stabilize this?

If it's relevant, I am using Android Studio 2.0.0


To clarify, I'm talking about the XML file's source code not the rendered output.

like image 275
Zoe stands with Ukraine Avatar asked Jun 12 '16 16:06

Zoe stands with Ukraine


2 Answers

In case anyone else encounters this in the future, I've found that if you click on the little man with the hat at the bottom right, enable "Power Saving Mode" and switch down Highlighting level to "None", it reduces the XML editing lag in complex layouts.

Once you make the edit, you can disable Power Saving and slide highlighting back up to see the changes in Preview.

Not ideal, but it prevents the constant pauses between keypresses whilst editing.

like image 108
AxeManTOBO Avatar answered Oct 18 '22 01:10

AxeManTOBO


Probably the "Preview" tab is open? If so, just close it. The rendering process takes up a lot of processing power.

like image 2
Malik Avatar answered Oct 18 '22 00:10

Malik