0

I have been able to fetch json content from my wordpress site using the following code

   private void parseResult(String result) {
    try {
        JSONObject response = new JSONObject(result);
        JSONArray posts = response.optJSONArray("posts");
        feedsList = new ArrayList<>();

        for (int i = 0; i < posts.length(); i++) {
            JSONObject post = posts.optJSONObject(i);

            FeedItem item = new FeedItem();
            item.setTitle(post.optString("title"));
            item.setContent(post.optString("content"));
            item.setExcerpt(post.optString("excerpt"));
            item.setdate(post.optString("date"));
            item.setPostUrl(post.getString("url"));



            JSONArray attachments = post.getJSONArray("attachments");
            if (null != attachments && attachments.length() > 0) {
                JSONObject attachment = attachments.getJSONObject(0);
                if (attachment != null)
                    item.setAttachmentUrl(attachment.getString("url"));
            }

            JSONObject author = post.getJSONObject("author");
            item.setAuthorname(author.optString("name"));

in my app the content is displayed in a text view but in the website some post contents contain images in the content and links but can't be clicked because the content is displayed in a text view. So what i'll to know is how to fetch the data in a webview so that the images and links could be displayed. Thanks.

ryda_007
  • 25
  • 1
  • 9

0 Answers0