Сначала думала что это проблема rss-ссылки, но такая история со всеми ссылками:
public class RssItem {
private final String title;
private String description;
private final String link;
private int id;
private byte[] thumbnailBytes;
public RssItem(String title, String link) {
this.title = title;
this.link = link;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getTitle() {
return title;
}
public String getLink() {
return link;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public byte[] getThumbnailBytes() {
return thumbnailBytes;
}
public void setThumbnailBytes(byte[] thumbnailBytes) {
this.thumbnailBytes = thumbnailBytes;
}
public RssItem(int id, String title, String description, String link,
byte[] imageBytes) {
super();
this.title = title;
//this.description = description;
this.link = link;
this.id = id;
this.thumbnailBytes = imageBytes;
}
}
И вот адаптор:
public class RssAdapter extends BaseAdapter {
private final List<RssItem> items;
private final Context context;
public RssAdapter(Context context, List<RssItem> items) {
this.items = items;
this.context = context;
}
@Override
public int getCount() {
return items.size();
}
@Override
public Object getItem(int position) {
return items.get(position);
}
@Override
public long getItemId(int id) {
return id;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
ViewHolder holder;
if (convertView == null) {
convertView = View.inflate(context, R.layout.rss_item, null);
holder = new ViewHolder();
holder.itemTitle = (TextView) convertView
.findViewById(R.id.itemTitle);
convertView.setTag(holder);
} else {
holder = (ViewHolder) convertView.getTag();
}
holder.itemTitle.setText(items.get(position).getTitle());
return convertView;
}
static class ViewHolder {
TextView itemTitle;
}
}
RssItem.java:
public class RssItem {
private final String title;
private String description;
private final String link;
private int id;
private byte[] thumbnailBytes;
public RssItem(String title, String link) {
this.title = title;
this.link = link;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getTitle() {
return title;
}
public String getLink() {
return link;
}
public int getId() {
return id;
}
public void setId(int id) {
this.id = id;
}
public byte[] getThumbnailBytes() {
return thumbnailBytes;
}
public void setThumbnailBytes(byte[] thumbnailBytes) {
this.thumbnailBytes = thumbnailBytes;
}
public RssItem(int id, String title, String description, String link,
byte[] imageBytes) {
super();
this.title = title;
this.description = description;
this.link = link;
this.id = id;
this.thumbnailBytes = imageBytes;
}
}