Does LayoutInflater loads xml layout resource every time when we load view using it?
View view = LayoutInflater.from(context).inflate(R.layout.resource, null);
For example, if I want to create 100 views with the same layout id, will it parse 100 times the same XML file or there is some android framework's cache system?
I guess yes, It loads 100 times..because every time the same statement gets executed..
That's why we have different adapter
and using their getView
we create/inflate the view only once and then after just copy paste the same object with different values in it.that we make the viewholder
You too should do something that way.. the if..else in getView method
I was about to post comment but as it become so longer copied as answer , will try to put more code and explanation later, if i got any relevant