Beispiel #1
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Set our view from the "main" layout resource
            SetContentView(Resource.Layout.Main);
            EmployeeList employeeList = new EmployeeList();
            var          employees    = employeeList.GetEmployees(20);

            ListView        lvEmployees = FindViewById <ListView>(Resource.Id.lvEmployee);
            EmployeeAdapter adapter     = new EmployeeAdapter(employees);

            lvEmployees.Adapter = adapter;
        }
Beispiel #2
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            var employees = EmployeeList.GetEmployees(20);

            ListView listEmployees = FindViewById <ListView>(Resource.Id.listView1);
            //ArrayAdapter<Employee> adapter = new ArrayAdapter<Employee>(
            //        this,
            //        Android.Resource.Layout.SimpleListItem1,
            //        employees
            //    );
            EmployeeAdapter adapter = new EmployeeAdapter(employees);

            listEmployees.Adapter = adapter;
        }
Beispiel #3
0
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

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

            EmployeeList employeeList = new EmployeeList();
            var          employes     = employeeList.GetEmployees(20);

            //atribui o controle de Listiew pelo Id
            ListView lvEmployess = FindViewById <ListView>(Resource.Id.lvEmployee);
            //adaptador para inserir os dados no listview
            //ArrayAdapter<Employee> adapter = new ArrayAdapter<Employee>(this, Android.Resource.Layout.SimpleListItem1, employes);
            //atribiu o adaptador na propriedade de adaptador do listview
            EmployeeAdapter adapter = new EmployeeAdapter(employes);

            lvEmployess.Adapter = adapter;
        }