我试图在下面的代码段中连接到 linkUrl ,然后从中获取假定为文本格式的内容,最后使用变量*将该内容保存在sqlite数据库中linkData)*。
有人帮助我如何在我的android应用中执行这些步骤。
谢谢。
for (int i = 0; i < li.size(); i++) {
/* These are the values that will be collected */
String title;
String date;
String imageUrl;
String linkUrl;
String linkData;
// Extract the value for the keys called "post-title", "date", "post-footer-author",
// "img", "abs:src", "a" and "href".
title = li.get(i).getElementsByClass("post-title").text();
date = li.get(i).getElementsByClass("date").text();
imageUrl = li.get(i).getElementsByTag("img").attr("abs:src");
**linkUrl = li.get(i).getElementsByTag("a").attr("abs:href");**
**linkData = ??????;**
ContentValues newsValues = new ContentValues();
newsValues.put(NewsContract.LatestNewsEntry.COLUMN_TITLE, title);
newsValues.put(NewsContract.LatestNewsEntry.COLUMN_DATE, date);
newsValues.put(NewsContract.LatestNewsEntry.COLUMN_IMAGE, imageUrl);
newsValues.put(NewsContract.LatestNewsEntry.COLUMN_LINK, linkUrl);
newsValues.put(NewsContract.LatestNewsEntry.COLUMN_DATA, linkData);
newsContentValues[i] = newsValues;
}