public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.Inflate(Resource.Layout.SendBirdFragmentMemberList, container, false); InitUIComponents(rootView); mMemberListQuery = SendBirdSDK.QueryMemberList(mChannelUrl); mMemberListQuery.OnResult += (sender, e) => { mAdapter.AddAll(e.Members); if (e.Members.Count <= 0) { Toast.MakeText(this.Activity, "No members.", ToastLength.Short).Show(); } }; mMemberListQuery.Next(); // actually query to get member list via API Client return(rootView); }
public override View OnCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) { View rootView = inflater.Inflate(Resource.Layout.SendBirdFragmentMemberList, container, false); InitUIComponents(rootView); mMemberListQuery = SendBirdSDK.QueryMemberList(mChannelUrl); mMemberListQuery.OnResult += (sender, e) => { mSyncContext.Post(delegate { mAdapter.AddAll(e.Members); if (e.Members.Count <= 0) { Toast.MakeText(this.Activity, "No members.", ToastLength.Short).Show(); } }, null); }; mMemberListQuery.OnError += (sender, e) => { Console.WriteLine(e.Exception.Message); }; mMemberListQuery.Get(); return(rootView); }