OSDN Git Service

Cache inflated view to avoid inflation of layouts in preferences
authorSuchi Amalapurapu <asuchitra@google.com>
Mon, 28 Sep 2009 07:29:15 +0000 (00:29 -0700)
committerSuchi Amalapurapu <asuchitra@google.com>
Mon, 28 Sep 2009 07:46:05 +0000 (00:46 -0700)
commit01dbc2ed55a081d41d233e891ea1ea1b0484f383
tree10753db0a8f63805d4233d85247261028ed43ce8
parent81384bf927c47a4efa653b14273084a13e67e3ac
Cache inflated view to avoid inflation of layouts in preferences
If layout id is specified for a Preference object, convertView is set to null
in its adapter which results in inflation of Preference view in getView each time the Preference object is laid out on the screen.
Just use an instance variable to cache the inflated view nulling it whenever the layout changes and use it in initing the convertView in getView.
core/java/android/preference/Preference.java