Back to project page BarcodeTest.
The source code is released under:
Copyright (c) 2014, zhongwcool All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * R...
If you think the Android project BarcodeTest listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.zxing.view; /*from ww w. j av a 2s . c o m*/ import java.util.List; import com.ericssonlabs.R; import android.content.Context; import android.view.LayoutInflater; import android.view.View; import android.view.ViewGroup; import android.widget.BaseAdapter; import android.widget.ImageView; import android.widget.TextView; public class ResultUrlAdapter extends BaseAdapter { private Context context; private LayoutInflater inflater; private List<String> _list; private int iconFlag; public ResultUrlAdapter(Context context, List<String> _urllist, int _flag) { super(); this.context = context; inflater = LayoutInflater.from(context); _list = _urllist; iconFlag = _flag; } @Override public int getCount() { // TODO Auto-generated method stub return _list.size(); } @Override public Object getItem(int position) { // TODO Auto-generated method stub return _list.get(position); } @Override public long getItemId(int position) { // TODO Auto-generated method stub return position; } @Override public View getView(int position, View convertView, ViewGroup parent) { if (convertView == null) { convertView = inflater.inflate(R.layout.list_item_search_result, null); } ImageView iv_search_result = (ImageView) convertView .findViewById(R.id.iv_search_result); TextView tv_result_url = (TextView) convertView .findViewById(R.id.tv_result_url); String result_url = _list.get(position).toString(); tv_result_url.setText(result_url); if (iconFlag == 0) { iv_search_result.setImageResource(R.drawable.net_right); } else if (iconFlag == 1) { iv_search_result.setImageResource(R.drawable.icon_call); } return convertView; } }