Exemplo n.º 1
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.dbHelper = new NotesDbAdapter(this);
            this.dbHelper.Open();

            SetContentView(Resource.Layout.note_edit);
            SetTitle(Resource.String.edit_note);

            this.titleText = (EditText)FindViewById(Resource.Id.title);
            this.bodyText  = (EditText)FindViewById(Resource.Id.body);

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

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

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

            this.PopulateFields();
            confirmButton.Click += delegate
            {
                SetResult(Result.Ok);
                this.Finish();
            };
        }
Exemplo n.º 2
0
        protected override void OnCreate(Bundle savedInstanceState)
        {
            base.OnCreate(savedInstanceState);
            this.dbHelper = new NotesDbAdapter(this);
            this.dbHelper.Open();

            SetContentView(Resource.Layout.note_edit);
            SetTitle(Resource.String.edit_note);

            this.titleText = (EditText)FindViewById(Resource.Id.title);
            this.bodyText = (EditText)FindViewById(Resource.Id.body);

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

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

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

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

            SetContentView(Resource.Layout.notes_list);

            this.dbHelper = new NotesDbAdapter(this);
            this.dbHelper.Open();
            this.FillData();

            RegisterForContextMenu(ListView);
        }
Exemplo n.º 4
0
 // Called when the activity is first created.
 protected override void OnCreate(Bundle savedInstanceState)
 {
     base.OnCreate(savedInstanceState);
     
     SetContentView(Resource.Layout.notes_list);
     
     this.dbHelper = new NotesDbAdapter(this);
     this.dbHelper.Open();
     this.FillData();
     
     RegisterForContextMenu(ListView);
 }