You are here

addFavorite

public void addFavorite (Node node) marks the specified node as a favorite.
Attention: This method was added in SDK version 1.2.

Parameters

Node node
A Node object. The node to add as a favorite for the current user.

Returns

void

Exception

Throws an SkyVaultServiceException if the operation cannot be completed.

Example

        
  // Add and/or remove a favorite
  final String testFolderName = "Sample Folder";
  Folder testFolder = (Folder) documentFolderService.getChildByPath(documentLibrary, testFolderName);
  Log.d(TAG, "1. Test folder is favorite: "+documentFolderService.isFavorite(testFolder));
  if (documentFolderService.isFavorite(testFolder)){
  	documentFolderService.removeFavorite(testFolder);
  }
  else {
  	documentFolderService.addFavorite(testFolder);
  }
  Log.d(TAG, "2. Test folder is favorite: "+documentFolderService.isFavorite(testFolder));