private void ReloadData(int startId)
        {
            m_AllTasks.Clear();
            foreach (var task in DataManager.GetClearedTasks(SortOption.Newest))
            {
                m_AllTasks.Add(task);
            }


            RunOnUiThread(() =>
            {
                ListAdapter = new ClearedTaskAdapter(this, m_AllTasks);
                if (ListView.Visibility == ViewStates.Gone)
                {
                    ListView.Visibility = ViewStates.Visible;
                    ListView.StartAnimation(AnimationUtils.LoadAnimation(this, Resource.Animation.fadein));
                }
            });

            if (startId == 0)
            {
                return;
            }

            var firstTask = m_AllTasks.FirstOrDefault(t => t.ID == startId);

            if (firstTask == null)
            {
                return;
            }

            var itemIndex = m_AllTasks.IndexOf(firstTask);

            RunOnUiThread(() => ListView.SetSelection(itemIndex));
        }
        protected override void OnCreate(Bundle bundle)
        {
            SetTheme(Settings.ThemeSetting == 0 ? Resource.Style.MyTheme : Resource.Style.MyThemeDark);

            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.History);


            m_AllTasks                = new JavaList <ClearedTaskModel>();
            ActionBar                 = FindViewById <ActionBar.ActionBar>(Resource.Id.actionbar);
            ActionBar.TitleRaw        = Resource.String.completed_tasks;
            ActionBar.CurrentActivity = this;
            AddHomeAction();
            RegisterForContextMenu(ListView);


            var saveState = LastNonConfigurationInstance as SaveStateHistory;

            if (saveState != null)
            {
                m_AllTasks = new JavaList <ClearedTaskModel>(saveState.Tasks);
                RunOnUiThread(() => ListAdapter = new ClearedTaskAdapter(this, m_AllTasks));
                RunOnUiThread(() => ListView.SetSelection(saveState.LastPosition));
                ListView.Visibility = ViewStates.Visible;
            }
            else
            {
                FlurryAgent.OnPageView();
                FlurryAgent.LogEvent("HistoryActivity");
                ReloadData(0);
            }

            SetupMainActionBar();
        }