private void filterCurrentAppWidgets(long currentScreenId,ArrayList<LauncherAppWidgetInfo> appWidgets,ArrayList<LauncherAppWidgetInfo> currentScreenWidgets,ArrayList<LauncherAppWidgetInfo> otherScreenWidgets){
  for (  LauncherAppWidgetInfo widget : appWidgets) {
    if (widget == null)     continue;
    if (widget.container == LauncherSettings.Favorites.CONTAINER_DESKTOP && widget.screenId == currentScreenId) {
      currentScreenWidgets.add(widget);
    }
 else {
      otherScreenWidgets.add(widget);
    }
  }
}

private void filterCurrentAppWidgets ( long currentScreenId , ArrayList < LauncherAppWidgetInfo > appWidgets , ArrayList < LauncherAppWidgetInfo > currentScreenWidgets , ArrayList < LauncherAppWidgetInfo > otherScreenWidgets ) { for ( LauncherAppWidgetInfo widget : appWidgets ) { if ( widget == null ) continue ; if ( widget . container == LauncherSettings . Favorites . CONTAINER_DESKTOP && widget . screenId == currentScreenId ) { currentScreenWidgets . add ( widget ) ; } else { otherScreenWidgets . add ( widget ) ; } } }
filters the set of widgets which are on the specified screen .
