Back to project page 101AndroidApps.
The source code is released under:
Licenced under the Creative Commons Attribution 4.0 licence. For full text see http://creativecommons.org/licenses/by/4.0/
If you think the Android project 101AndroidApps listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.hulzenga.ioi.android.app_008; /*w w w .ja va 2 s .co m*/ import android.content.Context; import android.text.Html; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.ArrayAdapter; import android.widget.TextView; import com.hulzenga.ioi.android.R; import java.util.List; /** * Created by jouke on 19-4-14. */ class OverheidFeedAdapter extends ArrayAdapter<OverheidFeedItem> { public OverheidFeedAdapter(Context context, List<OverheidFeedItem> list) { super(context, R.layout.app_008_item_feed, list); } private static class FeedItemHolder { TextView titleView; TextView pubDateView; TextView descriptionView; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { LayoutInflater inflater = (LayoutInflater) getContext().getSystemService(Context.LAYOUT_INFLATER_SERVICE); convertView = inflater.inflate(R.layout.app_008_item_feed, parent, false); FeedItemHolder holder = new FeedItemHolder(); holder.titleView = (TextView) convertView.findViewById(R.id.app_008_item_feed_title); holder.pubDateView = (TextView) convertView.findViewById(R.id.app_008_item_feed_pub_date); holder.descriptionView = (TextView) convertView.findViewById(R.id.app_008_item_feed_description); convertView.setTag(holder); } FeedItemHolder holder = (FeedItemHolder) convertView.getTag(); holder.titleView.setText(Html.fromHtml(getItem(position).getTitle())); holder.pubDateView.setText(Html.fromHtml(getItem(position).getPubDate())); holder.descriptionView.setText(Html.fromHtml(getItem(position).getDescription())); return convertView; } }