现在的位置: 首页 > 综合 > 正文

Android之BaseAdapter结构,拿来用原则

2013年04月03日 ⁄ 综合 ⁄ 共 419字 ⁄ 字号 评论关闭
class Adapter extends BaseAdapter {
		private LayoutInflater mLayoutInflater;
		
		public Adapter() {
			mLayoutInflater = LayoutInflater.from(mContext);
		}

		public int getCount() {
			return 0;
		}

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

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

		public View getView(final int position, View convertView, ViewGroup parent) {
			if(convertView == null) {
				convertView = mLayoutInflater.inflate(R.layout., parent, false);
			}
			return convertView;
		}
		
	}

 

抱歉!评论已关闭.