@Override public List<AppEntry> loadInBackground(){
  List<ApplicationInfo> apps=mPm.getInstalledApplications(PackageManager.GET_UNINSTALLED_PACKAGES | PackageManager.GET_DISABLED_COMPONENTS);
  if (apps == null) {
    apps=new ArrayList<>();
  }
  final Context context=getContext();
  List<AppEntry> entries=new ArrayList<>(apps.size());
  for (int i=0; i < apps.size(); i++) {
    AppEntry entry=new AppEntry(this,apps.get(i));
    entry.loadLabel(context);
    entries.add(entry);
  }
  Collections.sort(entries,ALPHA_COMPARATOR);
  return entries;
}

@ Override public List < AppEntry > loadInBackground ( ) { List < ApplicationInfo > apps = mPm . getInstalledApplications ( PackageManager . GET_UNINSTALLED_PACKAGES | PackageManager . GET_DISABLED_COMPONENTS ) ; if ( apps == null ) { apps = new ArrayList < > ( ) ; } final Context context = getContext ( ) ; List < AppEntry > entries = new ArrayList < > ( apps . size ( ) ) ; for ( int i = 0 ; i < apps . size ( ) ; i ++ ) { AppEntry entry = new AppEntry ( this , apps . get ( i ) ) ; entry . loadLabel ( context ) ; entries . add ( entry ) ; } Collections . sort ( entries , ALPHA_COMPARATOR ) ; return entries ; }
this is where the bulk of our work is done . this function is called in a background thread and should generate a new set of data to be published by the loader .
