I've been searching for help, but most posts are using an array adapter. I
don't 'think' that is what I can use. 
I have a requirement to use an autocomplete text view to provide suggestions
for an email address. When the user selects an address from the list, I'm to
populate the associated contacts name. The contact info will come from a
custom service, not the phone's contacts. All the posts I've seen use an
array adapter. I think I need to create a custom adapter to do this, but
have been really confused at the options. Should I create a custom adapter
that inherits from base adapter, or should it inherit from  array adapter
(or cursor adapter)? Do I need to implement IFilterable if I'm not doing a
custom filter? 
This is the non-working code I have:

  class EmailAutocompleteAdapter: ArrayAdapter<EmailContactItem>,IFilterable
    {
    
        private List<EmailContactItem> _items;
        private int _selectedPosition = -1;
        
        public EmailAutocompleteAdapter(Context context,
List<EmailContactItem>_items)
            :base(context,_items);
        {
        _items = new List<EmailContactItem>();
            //not sure how to implement
        }
        

        public int SelectedPosition
        {
            get { return _selectedPosition; }
            set
            {
                if (value < -1 || value >= this.Count)
                    throw new IndexOutOfRangeException();

                _selectedPosition = value;
            }
        }
        
        public override int Count
        {
            get { return _items.Count; }
        }
        public override Java.Lang.Object GetItem (int position) 
        {
            return _items[index];
        }
        public override long GetItemId(int position)
        {
            return _items[position].Index;
        }
       
        public override View GetView(int position, View convertView,
ViewGroup parent)
        {
            //not sure how to implement
            return new View(context);
        }


    }



--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/AutoCompleteTextView-tp5713249.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
[email protected]

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to