private void loadRootFolder ( ) { new Thread ( ) { @ Override public void run ( ) { try { //Api to fetch root folder final BoxIteratorItems folderItems = mFolderApi . getItemsRequest ( BoxConstants . ROOT_FOLDER_ID ) . send ( ) ; runOnUiThread ( new Runnable ( ) { @ Override public void run ( ) { mAdapter . clear ( ) ; for ( BoxItem boxItem : folderItems ) { mAdapter . add ( boxItem ) ; } } } ) ; } catch ( BoxException e ) { e . printStackTrace ( ) ; } } } . start ( ) ; }
Method to demonstrate fetching folder items from the root folder