Share via


ArrayAdapter.SetNotifyOnChange(Boolean) Method

Definition

Control whether methods that change the list (#add, #addAll(Collection), #addAll(Object[]), #insert, #remove, #clear, #sort(Comparator)) automatically call #notifyDataSetChanged.

[Android.Runtime.Register("setNotifyOnChange", "(Z)V", "GetSetNotifyOnChange_ZHandler")]
public virtual void SetNotifyOnChange (bool notifyOnChange);
[<Android.Runtime.Register("setNotifyOnChange", "(Z)V", "GetSetNotifyOnChange_ZHandler")>]
abstract member SetNotifyOnChange : bool -> unit
override this.SetNotifyOnChange : bool -> unit

Parameters

notifyOnChange
Boolean

if true, modifications to the list will automatically call #notifyDataSetChanged

Attributes

Remarks

Control whether methods that change the list (#add, #addAll(Collection), #addAll(Object[]), #insert, #remove, #clear, #sort(Comparator)) automatically call #notifyDataSetChanged. If set to false, caller must manually call notifyDataSetChanged() to have the changes reflected in the attached view.

The default is true, and calling notifyDataSetChanged() resets the flag to true.

Java documentation for android.widget.ArrayAdapter.setNotifyOnChange(boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to