soonoo
soonoo

Reputation: 907

Which is faster?: add view dynamically VS add view in .xml

I have a lot of views(TextView, View etc...) in my android app and I have two choices.(as you can see in title)

My question is -

Which one takes few resources and time when executed: add view programmatically or add view in a layout xml file manually?

Upvotes: 0

Views: 284

Answers (1)

StenSoft
StenSoft

Reputation: 9617

Adding views programatically is faster. When adding views from layout XML, it adds them in the same way but in addition, it needs to walk through that XML and use a lot of reflexion.

Upvotes: 1

Related Questions