protected override void OnResume() { base.OnResume(); allGoalsCollection = GoalManager.getInstance().AllGoals; GoalListAdapter adapter = new GoalListAdapter(this, allGoalsCollection); listView.Adapter = adapter; }
protected override void OnCreate(Bundle bundle) { base.OnCreate(bundle); // Set our view from the "main" layout resource SetContentView(Resource.Layout.HomeScreen); allGoalsCollection = GoalManager.getInstance().AllGoals; while (count < 6) { Goal newGoal = new Goal("Task number " + count, 5, 7, 2, "a new chalk bag"); allGoalsCollection.Add(newGoal); count++; } // Bind listview to all tasks goalsAdapter = new GoalListAdapter(this, allGoalsCollection); listView = FindViewById <ListView>(Resource.Id.allTasksListView); if (listView != null) { listView.Adapter = goalsAdapter; RegisterForContextMenu(listView); } }