public ArrayList<model_> countries_lang = new ArrayList<model_>();
Adapter_search adapt;
в вашем последующем
adapt = new Adapter_search(getActivity(), yourdata);
lv.setAdapter(adapt);
Класс адаптера
public class Adapter_search extends BaseAdapter
Context c;
ArrayList<model_> players;
CustomFilter filter;
ArrayList<model_> filterList;
SessionManager session;
boolean isSet;
Adapter_search myAdapter;
private int selectedPosition = 0;
public Adapter_search(Context ctx, ArrayList<model_> players) {
// TODO Auto-generated constructor stub
this.c = ctx;
this.players = players;
this.filterList = players;
session = new SessionManager(c);
}
@Override
public int getCount() {
// TODO Auto-generated method stub
return players.size();
}
@Override
public Object getItem(int pos) {
// TODO Auto-generated method stub
return players.get(pos);
}
@Override
public long getItemId(int pos) {
// TODO Auto-generated method stub
/* int itemID;
// orig will be null only if we haven't filtered yet:
if (players == null)
{
itemID = pos;
}
else
{
itemID = players.indexOf(filterList.get(pos));
}
return itemID;*/
return players.indexOf(getItem(pos));
}
@Override
public View getView(final int pos, View convertView, ViewGroup parent) {
// TODO Auto-generated method stub
myAdapter = new Adapter_search(c, players);
LayoutInflater inflater = (LayoutInflater)
c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
if (convertView == null) {
convertView = inflater.inflate(R.layout.search_popup, null);
}
TextView nameTxt = (TextView) convertView.findViewById(R.id.textView_titllename);
final ImageView img = (ImageView) convertView.findViewById(R.id.tick);
//SET DATA TO THEM
nameTxt.setText(players.get(pos).getLangName());
convertView.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View v) {
notifyDataSetChanged();
// Toast.makeText(c, players.get(pos).getLangName() + "+" +
players.get(pos).getid(), Toast.LENGTH_SHORT).show();
}
});
return convertView;
}
}
}