首页>代码>android 仿网易新闻客户端源码都有>/neteaseNews/src/com/zm/netease/adapter/NewsMoreAdapter.java
package com.zm.netease.adapter;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;

import com.zm.netease.R;

public class NewsMoreAdapter extends BaseAdapter{
	private String[] array;
	private LayoutInflater inflater;
	
	public NewsMoreAdapter(String[] array, Context context) {
		super();
		this.array = array;
		this.inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
	}

	@Override
	public int getCount() {
		return array.length;
	}

	@Override
	public Object getItem(int position) {
		return null;
	}

	@Override
	public long getItemId(int position) {
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		ViewHolder holder;
		if (convertView == null) {
			convertView = inflater.inflate(R.layout.layout_news_more_item, null);
			holder = new ViewHolder();
			holder.tv = (TextView) convertView.findViewById(R.id.tv_news_more_item);
			convertView.setTag(holder);
		} else {
			holder = (ViewHolder) convertView.getTag();
		}
		holder.tv.setText(array[position]);
		return convertView;
	}

	public static class ViewHolder {
		TextView tv;
	}
}
最近下载更多
宝藏男孩  LV1 2023年10月6日
2754137495  LV6 2023年3月29日
yang886  LV21 2023年3月5日
7894561  LV1 2022年6月7日
wangyunhao  LV10 2022年5月17日
511076827  LV33 2022年4月11日
张信哲  LV8 2021年5月7日
wangwenzhong  LV9 2020年12月25日
JavaPro_Allen  LV9 2020年10月20日
zhi_you90  LV1 2020年6月14日
最近浏览更多
666ing  LV2 2023年12月27日
学习112  LV2 2023年12月21日
微信网友_6768517354180608  LV1 2023年12月7日
花落亦知秋 2023年11月27日
暂无贡献等级
hhhhhz  LV7 2023年11月14日
宝藏男孩  LV1 2023年10月6日
panwill  LV5 2023年8月18日
wlhl1h  LV1 2023年7月17日
Yanguu 2023年7月11日
暂无贡献等级
wanglei92  LV2 2023年6月26日
顶部 客服 微信二维码 底部
>扫描二维码关注最代码为好友扫描二维码关注最代码为好友