package com.example.mountaintravel.adapter;


import java.util.List;

import com.smart.gtstrvl.R;


import android.content.Context;
import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.View.OnClickListener;
import android.widget.BaseAdapter;
import android.widget.ImageView;
import android.widget.TextView;

public class SearchAdapter extends BaseAdapter  {
   List <String >list;
   LayoutInflater mLayoutInflater;
   Context context;

	public SearchAdapter(Context context,List<String> list ) {
		super();
		this.mLayoutInflater = LayoutInflater.from(context);
		this.context = context;
		this.list=list;
	}

	@Override
	public int getCount() {
		// TODO Auto-generated method stub
		return list.size();
	}

	@Override
	public Object getItem(int position) {
		// TODO Auto-generated method stub
		return null;
	}

	@Override
	public long getItemId(int position) {
		// TODO Auto-generated method stub
		return 0;
	}

	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		if (convertView == null) {
			convertView = mLayoutInflater.inflate(R.layout.search_item_layout, parent, false);
		}
		TextView mView ;
		mView = (TextView) convertView.findViewById(R.id.search_item);
		mView.setText(list.get(position));
		return convertView;
	}

}
