Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @Override
- public View getView(int position, View convertView, ViewGroup parent) {
- LocationViewHolderItem viewHolder;
- if (convertView == null) {
- // inflate the layout
- LayoutInflater inflater = ((Activity) context).getLayoutInflater();
- convertView = inflater.inflate(resourceId, parent, false);
- // well set up the ViewHolder
- viewHolder = new LocationViewHolderItem();
- //ID of the TextView in the android.R.layout.simple_list_item_1
- viewHolder.location = (TextView) convertView.findViewById(R.id.activity_register_tv_location_item);
- viewHolder.poweredByGoogle = (ImageView) convertView.findViewById(R.id.activity_register_iv_powered_by_google);
- // store the holder with the view.
- convertView.setTag(viewHolder);
- } else {
- // we've just avoided calling findViewById() on resource every time
- // just use the viewHolder
- viewHolder = (LocationViewHolderItem) convertView.getTag();
- }
- String location = resultList.get(position);
- if (location != null) {
- if (location.equals(FOOTER)) {
- viewHolder.location.setVisibility(View.GONE);
- viewHolder.poweredByGoogle.setVisibility(View.VISIBLE);
- } else {
- viewHolder.poweredByGoogle.setVisibility(View.GONE);
- viewHolder.location.setVisibility(View.VISIBLE);
- viewHolder.location.setText(location);
- }
- }
- return convertView;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement