Cann't get data from listview ItemCLick!

EnglbachEnglbach VNMember ✭✭

In Customer Adapter
public List<A.Item> video { get; set; }
.....

void Lst_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
{
var intent = new Intent(this, typeof(VideoActivity));
var adapter = lst.Adapter as A.Item

        StartActivity(intent);

    }

adapter always get null. I don't understand

Answers

  • PubuduGayanPubuduGayan NZMember ✭✭✭
    edited July 2016

    Hi @Englbach this work for me.

    in your page Constructor

     var listView = this.FindByName<ListView>("listControlName");
    
            listView.ItemTapped += (sender, e) =>
            {
                YourFunction();
            };
    
            listView.ItemSelected += (sender, e) =>
            {
                YourFunction ();
            };
    

    (don't forget to mark as answer if it work for you. ;) )

  • EnglbachEnglbach VNMember ✭✭

    I mean var adapter = lst.Adapter as A.Item
    lst.Adapter have data but adapter is null.

Sign In or Register to comment.