Hi, 

I have a problem when selecting an item in a listview (not ListActivity).
Until now, when selecting, this item changes its background color using a
list_selector.xml.

The problem is when doing something when selecting that item. I have to do
someting and I didnt know how to call OnListItemClick.

In a listActivity I use 

protected override void OnListItemClick(ListView l, View v, int position,
long id)
        {
            try
            {

            }
            catch (Exception ex)
            {
                throw ex;
            }
        }

but when using a ListView in a layOut...

I think I can use OnItemClickListener or set a delegate in the getView
method in the adapter.

(view.Click += delegate { calcular(view, _CT.ID_CENTRO_TRABAJO); };)

This last option works but the background color of the item is not set. Is
Not using my list_selector.xml.

If I comment that line. The background color is set.

So... I think the item state changes or something...

I tried to rewrite the item state by setting pressed and selected properties
of the view and calling RefreshDrawableState method but no luck.

 row.Selected = false;
 row.Pressed = false;
 row.RefreshDrawableState();

Any help..please??

Thanks in advance...





--
View this message in context: 
http://mono-for-android.1047100.n5.nabble.com/ListView-Item-click-color-tp5712328.html
Sent from the Mono for Android mailing list archive at Nabble.com.
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

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

Reply via email to