I am trying to show the array size in Logcat for below code but is doesn`t show anything. What is wrong? Can somebody pls help?
@Override
protected Topic[] doInBackground(final Object... params) {
try {
final List<Topic> topics = new ArrayList<Topic>();
int page = 0;
int maxPage = 10;
while (page < maxPage) {
final String url = search.toURL();
final byte[] data = Downloader.download(url);
if (data != null) {
final ForumPage fp = Parser.parseForumPage(data);
page = fp.getPage();
maxPage = fp.getMaxPage();
for (final Topic t : fp.getTopics()) {
final String v = getVersion(t);
if (v != null && Util.compareVersions(v, minVersion) > 0){
topics.add(t);
}
System.out.println("SIZE: " + topics.size());
}
search.setStart(fp.getNextPageStart());
}
}
return topics.toArray(new Topic[topics.size()]);
} catch (final Exception e) {
Log.e(Constants.LOG, e.getMessage(), e);
}
return null;
}