Example #1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.dbHelper = new NamaadDbAdapter_note(this, "NamaadDB", 1, null, null);
            this.dbHelper.Open();

            SetContentView(Resource.Layout.cust_edit);
            SetTitle(Resource.String.edit_rec);

            this.nameText   = (EditText)FindViewById(Resource.Id.name);
            this.detailText = (EditText)FindViewById(Resource.Id.detail);

            var confirmButton = (Button)FindViewById(Resource.Id.confirm);

            this.rowId = ((savedInstanceState == null) ? null : savedInstanceState.GetSerializable(NamaadDbAdapter_note.KeyRowId)) as Long;

            if (this.rowId == null)
            {
                var extras = Intent.Extras;
                this.rowId = extras != null ? new Long(extras.GetLong(NamaadDbAdapter_note.KeyRowId))
                                                                                : null;
            }

            this.PopulateFields();
            confirmButton.Click += delegate
            {
                SetResult(Result.Ok);
                this.Finish();
            };
        }
        // Called when the activity is first created.
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);

            SetContentView(Resource.Layout.recs_list);

            this.dbHelper = new NamaadDbAdapter_note(this, DBName, DatabaseVersion, DatabaseCreate, TableDrop);
            this.dbHelper.Open();
            this.FillData();

            RegisterForContextMenu(ListView);
        }