use of com.amazon.android.model.content.Content in project zype-firebuilder by zype.
the class ContentBrowser method getWatchlistContent.
/**
* Get a list of content that belong in the watchlist.
*
* @return List of content.
*/
public List<Content> getWatchlistContent() {
List<Content> contentList = new ArrayList<>();
WatchlistDatabaseHelper databaseHelper = WatchlistDatabaseHelper.getInstance();
if (databaseHelper != null) {
List<String> contendIds = databaseHelper.getWatchlistContentIds(mAppContext);
for (String contentId : contendIds) {
Content content = mContentLoader.getRootContentContainer().findContentById(contentId);
if (content != null) {
contentList.add(content);
} else // The content is no longer valid so remove from database.
{
Log.d(TAG, "Content no longer valid");
databaseHelper.deleteRecord(mAppContext, contentId);
}
}
}
return contentList;
}
Aggregations