i would really need some help with the SearchView and my listview with custom list item. I think that my activity class is coded ok, but I really don't know what to do in my Adapter..
I will put the code of the Activity class if needed.. This is my Adapter for now:
public class List_message extends BaseAdapter implements Filterable {
private Context context;
private List<String> sender;
private List<String> type;
private LayoutInflater inflater;
public List_message(Context context,List<String> sender,List<String> type ) {
inflater = LayoutInflater.from( context );
this.context = context;
this.sender = sender;
this.type = type;
}
public int getCount() {
return sender.size();
}
public Object getItem(int position) {
return sender.get(position);
}
public long getItemId(int position) {
return position;
}
public View getView(final int position, View convertView, ViewGroup parent) {
String sender_tekst = sender.get(position);
String type_tekst = type.get(position);
View v = null;
if( convertView != null )
v = convertView;
else
v = inflater.inflate( R.layout.vrstica_private_message, parent, false);
TextView posiljatelj = (TextView)v.findViewById( R.id.message_sender);
posiljatelj.setText( sender_tekst );
TextView type = (TextView)v.findViewById( R.id.message_writer);
type.setText( type_tekst );
ImageButton button = (ImageButton)v.findViewById( R.id.message_delete);
button.setOnClickListener(
new OnClickListener() {
public void onClick(View v) {
}
});
return v;
}
public Filter getFilter() {
return null;
}
}