public static ArrayList<Long> loadWorkspaceScreensDb(Context context){
  final ContentResolver contentResolver=context.getContentResolver();
  final Uri screensUri=LauncherSettings.WorkspaceScreens.CONTENT_URI;
  final Cursor sc=contentResolver.query(screensUri,null,null,null,LauncherSettings.WorkspaceScreens.SCREEN_RANK);
  ArrayList<Long> screenIds=new ArrayList<Long>();
  try {
    final int idIndex=sc.getColumnIndexOrThrow(LauncherSettings.WorkspaceScreens._ID);
    while (sc.moveToNext()) {
      try {
        screenIds.add(sc.getLong(idIndex));
      }
 catch (      Exception e) {
        Launcher.addDumpLog(TAG,"Desktop items loading interrupted" + " - invalid screens: " + e,true);
      }
    }
  }
  finally {
    if (sc != null) {
      sc.close();
    }
  }
  return screenIds;
}

public static ArrayList < Long > loadWorkspaceScreensDb ( Context context ) { final ContentResolver contentResolver = context . getContentResolver ( ) ; final Uri screensUri = LauncherSettings . WorkspaceScreens . CONTENT_URI ; final Cursor sc = contentResolver . query ( screensUri , null , null , null , LauncherSettings . WorkspaceScreens . SCREEN_RANK ) ; ArrayList < Long > screenIds = new ArrayList < Long > ( ) ; try { final int idIndex = sc . getColumnIndexOrThrow ( LauncherSettings . WorkspaceScreens . _ID ) ; while ( sc . moveToNext ( ) ) { try { screenIds . add ( sc . getLong ( idIndex ) ) ; } catch ( Exception e ) { Launcher . addDumpLog ( TAG , "Desktop items loading interrupted" + " - invalid screens: " + e , true ) ; } } } finally { if ( sc != null ) { sc . close ( ) ; } } return screenIds ; }
loads the workspace screen ids in an ordered list .
