android listView 中存在editView chetxBox等点击事件处理
2010-05-24 16:32:00 来源:WEB开发网package com.o1.android.view;
import java.util.ArrayList;
import java.util.List;
import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
/**
* This list adapter is derived from the “Efficient List Adapter”-Example of
* API-Demos. It uses holder object to access the list items efficiently.
* Additionally, click listeners are provided, which can be connected to the
* arbitrary view items, e.g. customized checkboxes, or other clickable
* Image/TextViews. Implement subclasses of them and add your listeners to your
* “clickable” views.
*
* @author poss3x
*/
public abstract class ClickableListAdapter extends BaseAdapter {
private LayoutInflater mInflater;
private List mDataObjects; // our generic object list
private int mViewId;
/**
* This is the holder will provide fast access to arbitrary objects and
* views. Use a subclass to adapt it for your personal needs.
*/
public static class ViewHolder {
// back reference to our list object
public Object data;
}
/**
* The click listener base class.
*/
public static abstract class OnClickListener implements
View.OnClickListener {
private ViewHolder mViewHolder;
/**
* @param holder The holder of the clickable item
*/
public OnClickListener(ViewHolder holder) {
mViewHolder = holder;
}
// delegates the click event
public void onClick(View v) {
onClick(v, mViewHolder);
}
/**
- ››Android 当修改一些代码时,使用什么编译命令可以最...
- ››Android 如何添加一个apk使模拟器和真机都编译进去...
- ››Android 修改Camera拍照的默认保存路径
- ››Android 如何修改默认输入法
- ››android开发中finish()和System.exit(0)的区别
- ››Android手势识别简单封装类
- ››android中查看项目数字证书的两种方法
- ››Android中获取IMEI码的办法
- ››android 相机报错 setParameters failed
- ››Android重启运用程序的代码
- ››Android为ListView的Item设置不同的布局
- ››android bitmap与base64字符串的互相转换
更多精彩
赞助商链接