Skip to content

Commit

Permalink
Workaround to avoid OutOfMemoryError on some devices
Browse files Browse the repository at this point in the history
  • Loading branch information
javiersantos committed Jun 9, 2015
1 parent 824df1f commit 2054330
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,9 @@ public int compare(PackageInfo p1, PackageInfo p2) {
appListSource.add(packageInfo.applicationInfo.sourceDir);
appListData.add(packageInfo.applicationInfo.dataDir);
appListIcon.add(packageManager.getApplicationIcon(packageInfo.applicationInfo));
} catch (OutOfMemoryError e) {
//TODO Workaround to avoid FC on some devices (OutOfMemoryError). Drawable should be cached before.
appListIcon.add(getResources().getDrawable(R.drawable.ic_launcher));
} catch (Exception e) {
e.printStackTrace();
}
Expand All @@ -170,6 +173,9 @@ public int compare(PackageInfo p1, PackageInfo p2) {
appSystemListSource.add(packageInfo.applicationInfo.sourceDir);
appSystemListData.add(packageInfo.applicationInfo.dataDir);
appSystemListIcon.add(packageManager.getApplicationIcon(packageInfo.applicationInfo));
} catch (OutOfMemoryError e) {
//TODO Workaround to avoid FC on some devices (OutOfMemoryError). Drawable should be cached before.
appSystemListIcon.add(getResources().getDrawable(R.drawable.ic_launcher));
} catch (Exception e) {
e.printStackTrace();
}
Expand Down

0 comments on commit 2054330

Please sign in to comment.