public onRefereshPrivateLayout(HomeAdapterPrivateEvent privateEventAdapter, FragmentActivity context, SwipeRefreshLayout mSwipeRefreshLayout, RecyclerView rvPrivateEvent)
 {
     this.rvPrivateEvent      = rvPrivateEvent;
     this.mSwipeRefreshLayout = mSwipeRefreshLayout;
     this.privateEventAdapter = privateEventAdapter;
     this.context             = context;
 }
                protected override void OnPostExecute(Java.Lang.Object result)
                {
                    base.OnPostExecute(result);
                    var privateEventList = (from x in listPublicEvent where x.EventType == "M" select x).ToList();

                    privateEventAdapter = new HomeAdapterPrivateEvent(privateEventList, context);
                    rvPrivateEvent.SetAdapter(privateEventAdapter);
                    rvPrivateEvent.Invalidate();
                }
        protected override void OnPostExecute(Java.Lang.Object result)
        {
            base.OnPostExecute(result);
            p.Dismiss();
            tablayout.SetOnTabSelectedListener(this);
            emptyPrivateEvent = rootView.FindViewById <LinearLayout>(Resource.Id.emptyPrivateEvent);

            if (result != null && listPublicEvent.Count > 0)
            {
                try
                {
                    publicEventList  = (from x in listPublicEvent where x.EventType == "P" select x).ToList();
                    privateEventList = (from x in listPublicEvent where x.EventType == "M" select x).ToList();

                    HomeAdapterPublicEvent publicEventAdapter = new HomeAdapterPublicEvent(publicEventList, context);
                    privateEventAdapter = new HomeAdapterPrivateEvent(privateEventList, context);
                    rvPublicEvent.SetAdapter(publicEventAdapter);
                    rvPrivateEvent.SetAdapter(privateEventAdapter);
                    mSwipeRefreshLayoutpublic.SetOnRefreshListener(new onRefereshPublicLayout(publicEventAdapter, context, mSwipeRefreshLayoutpublic, rvPublicEvent));
                    mSwipeRefreshLayoutPrivate.SetOnRefreshListener(new onRefereshPrivateLayout(privateEventAdapter, context, mSwipeRefreshLayoutPrivate, rvPrivateEvent));


                    if (privateEventList.Count == 0)
                    {
                        emptyPrivateEvent.Visibility = ViewStates.Visible;
                    }
                    else
                    {
                        emptyPrivateEvent.Visibility = ViewStates.Gone;
                    }
                }
                catch (System.Exception ex)
                {
                    new CrashReportAsync("GetPublicEventData", "OnPostExecute", ex.StackTrace + ex.Message).Execute();
                }
            }

            else
            {
                emptyPrivateEvent.Visibility = ViewStates.Visible;
            }
        }
 public PullToRefreshGetPrivateData(FragmentActivity context, HomeAdapterPrivateEvent privateEventAdapter, RecyclerView rvPrivateEvent)
 {
     this.context             = context;
     this.privateEventAdapter = privateEventAdapter;
     this.rvPrivateEvent      = rvPrivateEvent;
 }
 private void Dosomething(HomeAdapterPrivateEvent privateEventAdapter, FragmentActivity context)
 {
     new PullToRefreshGetPrivateData(context, privateEventAdapter, rvPrivateEvent).Execute();
 }