protected override void onCreate(global::android.os.Bundle savedInstanceState) { // this activity // check for db table // // shall resume on boot // shall recheck every n seconds // shall remember the last result // shall remember how many iterations // shall remember how many boots base.onCreate(savedInstanceState); #region setContentView ScrollView sv = new ScrollView(this); LinearLayout ll = new LinearLayout(this); ll.setOrientation(LinearLayout.VERTICAL); sv.addView(ll); var that = (Context)this; this.CancelPendingAlarm(NotifyServiceFromTimer.Class); #region startservice startservice = new Button(this); startservice.setText("Start Timer"); startservice.setOnClickListener( new startservice_onclick { that = this } ); ll.addView(startservice); #endregion #region stopservice stopservice = new Button(this); stopservice.setText("Stop Timer"); stopservice.setEnabled(false); stopservice.setOnClickListener( new stopservice_onclick { that = this } ); ll.addView(stopservice); #endregion CheckBox cb = new CheckBox(this); cb.setText("Start the timer earlier!"); cb.setOnCheckedChangeListener(new cb_onchanged { that = this }); __SQLiteConnectionHack.Context = this; using (var c = new SQLiteConnection(AbstractNotifyService.ConnectionString)) { c.Open(); var MyDataTable = new MyDataTable(c); cb.setChecked(MyDataTable.StartEarlier == 1); c.Close(); } ll.addView(cb); this.setContentView(sv); #endregion var intent = new Intent(this, NotifyServiceFromActivity.Class); this.startService(intent); }
public override void InternalBeforeSetContext(android.content.Context c) { InternalElement = new CheckBox(c); InternalSetText(InternalText); }