资源简介
package com.great.baseadapter;
import java.util.ArrayList;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
public class MyBaseAdapter extends BaseAdapter {
private Context context;
private ArrayList<MyData> list;
private MyData data;
private ViewHolder holder;
public MyBaseAdapter(Context context, ArrayList<MyData> list) {
super();
this.context = context;
this.list = list;
}
//返回条目数
@Override
public int getCount() {
return list.size();
}
//得到某一条目
@Override
public Object getItem(int position) {
return list.get(position);
}
//返回条目值
@Override
public long getItemId(int position) {
return position;
}
//进行适配
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView tv_01 = null,tv_02=null;
//产生View
if(convertView==null)
{
convertView = LayoutInflater.from(context).inflate(R.layout.actvity_item, null);
holder = new ViewHolder();
holder.tv_01 = (TextView) convertView.findViewById(R.id.tv_01);
holder.tv_02 = (TextView) convertView.findViewById(R.id.tv_02);
//tv_01.setText(list.get(position).getText1());
//tv_02.setText(list.get(position).getText2());
convertView.setTag(holder);
}
else
{
holder = (ViewHolder) convertView.getTag();
// tv_01 = (TextView) convertView.findViewById(R.id.tv_01);
// tv_02 = (TextView) convertView.findViewById(R.id.tv_02);
//
// tv_01.setText(list.get(position).getText1());
// tv_02.setText(list.get(position).getText2());
}
holder.tv_01.setText(list.get(position).getText1());
holder.tv_02.setText(list.get(position).getText2());
return convertView;
}
private class ViewHolder
{
private TextView tv_01;
private TextView tv_02;
}
}
import java.util.ArrayList;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.TextView;
public class MyBaseAdapter extends BaseAdapter {
private Context context;
private ArrayList<MyData> list;
private MyData data;
private ViewHolder holder;
public MyBaseAdapter(Context context, ArrayList<MyData> list) {
super();
this.context = context;
this.list = list;
}
//返回条目数
@Override
public int getCount() {
return list.size();
}
//得到某一条目
@Override
public Object getItem(int position) {
return list.get(position);
}
//返回条目值
@Override
public long getItemId(int position) {
return position;
}
//进行适配
@Override
public View getView(int position, View convertView, ViewGroup parent) {
TextView tv_01 = null,tv_02=null;
//产生View
if(convertView==null)
{
convertView = LayoutInflater.from(context).inflate(R.layout.actvity_item, null);
holder = new ViewHolder();
holder.tv_01 = (TextView) convertView.findViewById(R.id.tv_01);
holder.tv_02 = (TextView) convertView.findViewById(R.id.tv_02);
//tv_01.setText(list.get(position).getText1());
//tv_02.setText(list.get(position).getText2());
convertView.setTag(holder);
}
else
{
holder = (ViewHolder) convertView.getTag();
// tv_01 = (TextView) convertView.findViewById(R.id.tv_01);
// tv_02 = (TextView) convertView.findViewById(R.id.tv_02);
//
// tv_01.setText(list.get(position).getText1());
// tv_02.setText(list.get(position).getText2());
}
holder.tv_01.setText(list.get(position).getText1());
holder.tv_02.setText(list.get(position).getText2());
return convertView;
}
private class ViewHolder
{
private TextView tv_01;
private TextView tv_02;
}
}
代码片段和文件信息
/** Automatically generated file. DO NOT MODIFY */
package com.great.baseadapter;
public final class BuildConfig {
public final static boolean DEBUG = true;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2015-10-06 22:01 ba
文件 475 2015-09-30 11:55 ba
文件 847 2015-09-30 11:55 ba
文件 884 2015-09-30 11:55 ba
目录 0 2015-10-25 12:32 ba
目录 0 2015-10-06 22:01 ba
文件 884 2015-09-30 11:55 ba
文件 282227 2015-09-30 11:55 ba
目录 0 2015-10-06 22:01 ba
目录 0 2015-10-06 22:01 ba
目录 0 2015-10-06 22:01 ba
目录 0 2015-10-06 22:01 ba
文件 351 2015-09-30 11:55 ba
文件 1983 2015-09-30 11:55 ba
文件 1170 2015-09-30 11:55 ba
文件 2691 2015-09-30 11:55 ba
文件 809 2015-09-30 11:55 ba
文件 349 2015-09-30 11:55 ba
文件 470 2015-09-30 11:55 ba
文件 416 2015-09-30 11:55 ba
文件 548 2015-09-30 11:55 ba
文件 448 2015-09-30 11:55 ba
文件 397 2015-09-30 11:55 ba
文件 481 2015-09-30 11:55 ba
文件 440 2015-09-30 11:55 ba
文件 703 2015-09-30 11:55 ba
文件 910700 2015-09-30 11:55 ba
目录 0 2015-10-06 22:01 ba
文件 234431 2015-09-30 11:55 ba
文件 943 2015-09-30 11:55 ba
目录 0 2015-10-06 22:01 ba
............此处省略51个文件信息
相关资源
- android xlistview 下拉刷新
- listView刷新
- Android防京东筛选ListView+CheckBox滑动冲
- JSON数据解析后显示在listview上并且可
- android--ListView下拉刷新demo
- android关于listview之列表分组
- Android横向滑动的listview
- HorizontalListView.java
- Android带复选框的树形组织架构treeLi
- AndroidListView解决嵌套滑动性能问题
- 经典的android listview非常简单漂亮
- Android:利用EditText和ListView 实现动态
- android ListView显示和隐藏二级内容
- Android wifi列表显示
- Android ListView控件显示数据库中图片
-
天气预报,xm
l解析 - Android 简单计时器
- News_AndroidStudio源代码
- Android 仿QQ侧滑删除—一个满足ListVi
- Android 为ListView每个Item上面的按钮添加
- Android 自定义ListView实现QQ空间界面(
- android PinnerListView
- android学生信息管理软件源代码
- android中listview的item滑动删除效果已解
- android listview点击保持背景颜色,实现
- Android ExpandableListView的两层嵌套
- [Android] 使用SQLite简单增删改查操作数
- Android 开源之StickyHeaderListView 标题渐变
- android-support-v7-recyclerview.jar
- Android 自定义ListView(下拉刷新PullTo
评论
共有 条评论