Пример #1
0
        protected override void OnAppearing()
        {
            base.OnAppearing();

            // Reset the 'resume' id, since we just want to re-start here
            ((App)App.Current).ResumeAtTodoId = -1;
            AcademyMgr.AcademyMgr manager = new AcademyMgr.AcademyMgr();
            manager.Initialize();
            listView.ItemsSource = manager.getMembers();

            //listView.ItemsSource = await App.Database.GetItemsAsync();
        }
Пример #2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            SetContentView(Resource.Layout.activity_main);

            Android.Support.V7.Widget.Toolbar toolbar = FindViewById <Android.Support.V7.Widget.Toolbar>(Resource.Id.toolbar);
            SetSupportActionBar(toolbar);

            AcademyMgr.AcademyMgr manager = new AcademyMgr.AcademyMgr();
            manager.Initialize();

            FloatingActionButton fab = FindViewById <FloatingActionButton>(Resource.Id.fab);

            fab.Click += FabOnClick;

            ListView mainListView = FindViewById <ListView>(Resource.Id.listView1);

            // Create and populate a List of planet names.
            String[] planets = new String[] { "Mercury", "Venus", "Earth", "Mars",
                                              "Jupiter", "Saturn", "Uranus", "Neptune" };
            List <String> planetList = new List <String>();

            planetList.AddRange(planets);

            // Create ArrayAdapter using the planet list.
            ArrayAdapter <String> listAdapter = new ArrayAdapter <String>(this, 1, planetList);

            // Add more planets. If you passed a String[] instead of a List<String>
            // into the ArrayAdapter constructor, you must not add more items.
            // Otherwise an exception will occur.
            listAdapter.Add("Ceres");
            listAdapter.Add("Pluto");
            listAdapter.Add("Haumea");
            listAdapter.Add("Makemake");
            listAdapter.Add("Eris");

            // Set the ArrayAdapter as the ListView's adapter.
            mainListView.Adapter = listAdapter;
        }