Code example for ContentHandler

Methods: getContent

    private static DocumentInfo loadDocument(ContentHandler handler, Uri uri) throws IOException {
        String spec = uri.toString();
        URL url = new URL(spec);
        URLConnection connection = url.openConnection();
        Object content = handler.getContent(connection);
        if (content instanceof DocumentInfo) {
            return (DocumentInfo) content;
        } else { 
            String message = "ContentHandler must return FeedLoader.documentInfo(...)";
            throw new RuntimeException(message);
     * Loads a feed that is contained in a single document. 
     * @param handler a {@link ContentHandler} that parses a document and 
     *            returns {@link FeedLoader#documentInfo()} or 
     *            {@link FeedLoader#documentInfo(int)}. The feed data is