Forum Xamarin.Android

Search inside ListAdapter

Hey everyone,

I would really appreciate if someone could help me with search inside Listadapter. I couldn't get it to work.

Adapter Class

                class NoteAdapter:ArrayAdapter
        private Activity activity;

        public NoteAdapter(Activity activity, Context context, int textViewResourceId, object[] objects)
            : base(context, textViewResourceId, objects)
            this.activity = activity;

        public override Android.Views.View GetView(int position, Android.Views.View convertView, Android.Views.ViewGroup parent)
            var item = (UserModel)this.GetItem(position);

            var view = (convertView ?? activity.LayoutInflater.Inflate(Resource.Layout.NoteListRow, parent, false)) as LinearLayout;

            view.FindViewById<TextView>( = item.Name.Replace("\n", " ");

            return view;


    public class SessionsActivity : ListActivity

        UserDetails noterep = new UserDetails();
        protected override void OnCreate(Bundle savedInstanceState)

        public void PopulateList()
            var notes = noterep.GetAllNotes();
            var adapter = new NoteAdapter(this, this, Resource.Layout.NoteListRow, notes.ToArray());
            ListAdapter = adapter;

Any ideas are welcome,


Sign In or Register to comment.