WEB开发网
开发学院手机开发Android 开发 android listView 中存在editView chetxBox等点击... 阅读

android listView 中存在editView chetxBox等点击事件处理

 2010-05-24 16:32:00 来源:WEB开发网   
核心提示:* Implement your click behavior here* @param v The clicked view.*/public abstract void onClick(View v, ViewHolder viewHolder);};/*** The long click listener bas

* Implement your click behavior here

* @param v The clicked view.

*/

public abstract void onClick(View v, ViewHolder viewHolder);

};

/**

* The long click listener base class.

*/

public static abstract class OnLongClickListener implements

View.OnLongClickListener {

private ViewHolder mViewHolder;

/**

* @param holder The holder of the clickable item

*/

public OnLongClickListener(ViewHolder holder) {

mViewHolder = holder;

}

// delegates the click event

public boolean onLongClick(View v) {

onLongClick(v, mViewHolder);

return true;

}

/**

* Implement your click behavior here

* @param v The clicked view.

*/

public abstract void onLongClick(View v, ViewHolder viewHolder);

};

/**

* @param context The current context

* @param viewid The resource id of your list view item

* @param objects The object list, or null, if you like to indicate an empty

* list

*/

public ClickableListAdapter(Context context, int viewid, List objects) {

// Cache the LayoutInflate to avoid asking for a new one each time.

mInflater = LayoutInflater.from(context);

mDataObjects = objects;

mViewId = viewid;

if (objects == null) {

mDataObjects = new ArrayList

/**

* The number of objects in the list.

*/

public int getCount() {

return mDataObjects.size();

}

/**

* @return We simply return the object at position of our object list Note,

* the holder object uses a back reference to its related data

* object. So, the user usually should use {@link ViewHolder#data}

上一页  1 2 3 4 5 6 7  下一页

Tags:android listView 存在

编辑录入:coldstar [复制链接] [打 印]
赞助商链接