diff options
Diffstat (limited to 'src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java')
-rw-r--r-- | src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java b/src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java index 1daaf715..22f6c3c9 100644 --- a/src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java +++ b/src/com/cyanogenmod/filemanager/adapters/AssociationsAdapter.java @@ -95,7 +95,7 @@ public class AssociationsAdapter this.mOnItemClickListener = onItemClickListener; //Do cache of the data for better performance - processData(); + processData(intents); } /** @@ -103,7 +103,7 @@ public class AssociationsAdapter */ @Override public void notifyDataSetChanged() { - processData(); + processData(null); super.notifyDataSetChanged(); } @@ -117,13 +117,15 @@ public class AssociationsAdapter /** * Method that process the data before use {@link #getView} method. + * + * @param intents The list of intents (to better performance) or null. */ - private void processData() { + private void processData(List<ResolveInfo> intents) { this.mData = new DataHolder[getCount()]; - int cc = getCount(); + int cc = (intents == null) ? getCount() : intents.size(); for (int i = 0; i < cc; i++) { //Intent info - ResolveInfo intentInfo = getItem(i); + ResolveInfo intentInfo = (intents == null) ? getItem(i) : intents.get(i); //Build the data holder this.mData[i] = new AssociationsAdapter.DataHolder(); |