예제 #1
0
        protected override void OnResume()
        {
            base.OnResume();

            List <Person> list = new List <Person>();

            for (int i = 0; i < 20; i++)
            {
                list.Add((Person)_db.Read(i));
            }

            FindViewById <RecyclerView>(Resource.Id.recyclerView).SetAdapter(new RecyclerAdapter(list));
        }
예제 #2
0
        protected override void OnResume()
        {
            base.OnResume();
            db = new RealmHandler();
            Person p = db.Read(Intent.GetIntExtra("id", 0)) as Person;

            if (p != null)
            {
                FindViewById <TextView>(Resource.Id.editPersonId).Text  = p.Id.ToString();
                FindViewById <EditText>(Resource.Id.editPersonFn).Text  = p.Fn;
                FindViewById <EditText>(Resource.Id.editPersonLn).Text  = p.Ln;
                FindViewById <EditText>(Resource.Id.editPersonAge).Text = p.Age.ToString();
            }

            FindViewById <Button>(Resource.Id.editPersonSaveBtn).Click += delegate { OnBackPressed(); };
        }