Xamerin Android ListView is not populating when setting Adapter in a callback mathod

anoopmanoopm USMember
edited September 2013 in Xamarin.Android

am trying to populating ListView by loading data using a Web Service.

And i set code for setting ListView Adapterin the CallBack Method. But Adapter GetView Override method is not firing in this case & ListView is not populating.

But it works when i set adapter inOnCreate(Bundle bundle) Method with dummy data.
Anybody know what i missed ? Do i need call any UI Update method here?

  protected List<Product> Products { get; set; }

  protected void FillProductListCallBack(List<Product> products)
  {
    if (products.Any())
    {
     Products = products;
     ProductListView = FindViewById<ListView>(Resource.Id.lstList);
     ProductListView.Adapter = new ProductScreenAdapter(this, Products);
     ProductListView.SetBackgroundColor(Color.Red);
    }
  }
Sign In or Register to comment.