Forum Xamarin.Android

How to always refresh listview in android?

Luis_dmLuis_dm USMember ✭✭✭

I am using ListView in android but i need update whenever I add an element

Answers

  • OmmyOmmy AUMember ✭✭

    @LuisRodriguez92 Hello Luis, If you use ObservableCollection as Listview itemsource, it should automatically update the new element, but in case if you want to update the binding of item then need to implement INotifyPropertyChanged.

  • JMHdezJMHdez BRMember

    @LuisRodriguez92 The solution is define an ObservableCollection on your ViewModel(or BindingContext) and bind de ListView itemsource to ObservableCollection

  • Luis_dmLuis_dm USMember ✭✭✭

    But for Xamarin.Android?

    Xamarin.Forms not

  • Lainio47Lainio47 USMember ✭✭

    have you tried notifySetDataChanged()?

  • Luis_dmLuis_dm USMember ✭✭✭

    Yes, but not work :/

Sign In or Register to comment.